Comments

cloudbull’s picture

Is it hard to do?

I just checked the code and many func are the same...
I'm trying and report if I made it

Keith

mradcliffe’s picture

I was working on this myself a couple of months ago, but I had to drop what I was doing to focus on other things. I will be able to work and test this more /soon/.

mradcliffe’s picture

Status: Active » Needs review
StatusFileSize
new7.52 KB
new33.49 KB

Attached are two patches. I decided to re-branch from 6.x-3.x as the current "7.x-3.x" branch nowhere near matches it (look at the size of that sucker). The first patch will take you from that current branch to my port, and the second patch will take you from 6.x-3.x to my port.

What's working:

  • Debugging for definition and client.
  • Should work with an actual implementation. I should be able to report back more today.

What's not working

  • tests. Throws an error. I tried doing a curl call directly and I did *not* receive the 404 error so I do know that the endpoint is working. It's definitely an issue with the Soap class and SimpleTest.
mradcliffe’s picture

This has been frustrating me the entire afternoon... Heh... I just needed to think out loud with another developer here. I believe this is now working 100% with some additional changes.

Edit: removed some questions I had.

jaxxed’s picture

@mradcliffe: I need this for a project that I'm working on right now. I'd be happy to help where I can. is it in git? i'll check it out and look now.

mradcliffe’s picture

StatusFileSize
new31.73 KB
new3.52 KB

I was having trouble with a custom wsdl file and complex array types, and like others have found, this module really does need custom wsdl (see the hook).

I have a local git repository that I'm committing to. I just realized that the patches would be better if I used "git format-patch". It's easiest to checkout origin/6.x-3.x and applythe two patches within 6.x-3.x-7.x-3.x although applying all the patches to a origin/7.x-3.x checkout would be best.

Thanks for testing. :-)

mradcliffe’s picture

StatusFileSize
new4.26 KB

I merged in changes from origin/6.x-3.x again. Since origin/7.x-3.x is out-of-date, I'll just format-patch from origin/6.x-3.x to 7.x-3.x (local) from now on.

I think patch 0001, which removes CVS tags can and should be applied to origin/6.x-3.x as that branch has CVS tags again.

cloudbull’s picture

I tried to use the port but giving the following error:

Warning: SoapClient::SoapClient(http://XXXX.com/XXX/?q=test_soap?wsdl): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in soap_server_debug_client() (line 315 of /var/www/html//sites/all/modules/soap_server/soap_server.module).
Warning: SoapClient::SoapClient(): I/O warning : failed to load external entity "http://XXXXXX.com/XXX/?q=test_soap?wsdl" in soap_server_debug_client() (line 315 of /var/www/html//sites/all/modules/scp_soap_server/soap_server.module).

Anyone can help ?

Thanks
Keith

marcus_clements’s picture

I've only tested the WSDL URL with clean URLs switched on. It wouldn't be very difficult to add a menu callback and function to expose the WSDL at [endpoint_name]/wsdl as well. I chose [endpoint_name]?wsdl as that seems to be standard amongst SOAP implementations.

If you do this, please post a patch - I'll be happy to review and commit to the 6.x-3.x branch.

raj_m’s picture

Priority: Critical » Major
StatusFileSize
new884 bytes

soap server integration

raj_m’s picture

StatusFileSize
new1.84 KB

If i select as REST SERVER an xml output on the browser

raj_m’s picture

Version: 6.x-3.x-dev » 6.x-3.0-alpha1
Priority: Normal » Critical

Hi All,

how to integrate soap server with services module in drupal 7 when user submit form get an xml?

Thanks,
RAJ

mradcliffe’s picture

This isn't the correct issue for a support request, Raj. You need to make a SOAP request to the endpoint URL. Try via SoapClient or Soap UI program.

cloudbull’s picture

Now i can get the wsdl, BTW, it shows another error which throw from exception which comes from the debug_client

faultstring (String, 33 characters ) looks like we got no XML document
faultcode (String, 6 characters ) Client
faultcodens (String, 41 characters ) http://schemas.xmlsoap.org/soap/envelope/

Any idea ?

Many thanks
Keith

cloudbull’s picture

I think it cause by there is 2 new line before my <?xml tag and 1 new line after of the response body.

Any idea to remove them ?

Many thanks
Keith

mradcliffe’s picture

Version: 6.x-3.0-alpha1 » 6.x-3.x-dev
Priority: Major » Normal
StatusFileSize
new20.2 KB

Per rayvaughn's request, patching again from origin/7.x-3.x. This includes patches from origin/6.x-3.x via git format-patch.

domidc’s picture

Can anyone package a tarball of the result of all patching?

domidc’s picture

Tried to apply the patches with "git apply [0001-...]"

Got this error:

0001-Adding-the-first-version-of-Soap-Server-for-Services.patch:131: trailing whitespace.
*
0001-Adding-the-first-version-of-Soap-Server-for-Services.patch:134: trailing whitespace.
*
0001-Adding-the-first-version-of-Soap-Server-for-Services.patch:159: trailing whitespace.
*
0001-Adding-the-first-version-of-Soap-Server-for-Services.patch:169: trailing whitespace.
// soap_server_wsdl_output() delivers the wsdl and exits
0001-Adding-the-first-version-of-Soap-Server-for-Services.patch:175: space before tab in indent.
$server->setClass(ServicesSoapServer);
error: patch failed: README.txt:1
error: README.txt: patch does not apply
error: patch failed: soap_server.info:1
error: soap_server.info: patch does not apply
error: patch failed: soap_server.module:1
error: soap_server.module: patch does not apply
error: soap_server_test.php: No such file or directory
error: wsdl/soap_server.wsdl.inc: already exists in working directory

Can anyone help? It seems the patch doesnt apply?

mradcliffe’s picture

Ugh, what the hell. Git makes patches that it then can't apply? That's really dumb.

mradcliffe’s picture

Okay, so this is essentially the same thing all rolled into one patch. We just lost all of the commit history by doing this (also if trying to format-patch from 6.x-3.x apparently), but it works. It will bring up origin/7.x-3.x branch up to speed the old fashioned way.

Edit: remember this brings you from the very, very, very ancient origin/7.x-3.x up to changes introduced in origin/6.x-3.x and porting to Drupal 7.

Edit: see post below instead.

mradcliffe’s picture

Okay, I think I have a set of patches that will work that keep history. I thought I was rebasing correctly, but I might not have been. It's still silly to me that git format-patch will create patches that it can't apply, but whatever.

domidc’s picture

I confirm the newly rolled patches are working. Thanks @mradcliffe.

mradcliffe’s picture

Thanks, domidc. Sorry for the patch trouble.

k.sorokin’s picture

Can someone please post patched version here? , because I have troubles with posted patches. Thanks

domidc’s picture

StatusFileSize
new7.06 KB

konstantin.40in had the same problem a couple of weeks ago but the new patches should work. I used these commands to do it:

git clone --branch 7.x-3.x http://git.drupal.org/project/soap_server.git
cd soap_server
git apply -v [patchname.patch] //for all 17 patches

Anyway I attached the patched version in case you have trouble.

k.sorokin’s picture

domidc, thank you very much!

kleinmp’s picture

The patches from mradcliffe in comment #21 are working nicely for me.

tsphethean’s picture

This is great, thanks domidc and mradcliffe. Will this appear as an official release on the project page anytime soon? I only found this issue by accident and would be useful for anyone else looking for SOAP Server in D7.

chingis’s picture

chingis’s picture

Hello

I have an error when I try to get wsdl by soapUI-4.0

WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'xsd:array'.

here is my resources definition:

  $items['name']['method'] = array(
    'help' => t('method'),
    'callback' => 'method_callback',
    'access arguments' => array('access content'),
    'access arguments append' => FALSE,
    'args' => array(
      array(
        'name' => 'data',
        'optional' => FALSE,
        'source' => array('data' => 'name'),
        'description' => t('Data'),
        'type' => 'array',
      )
    )
  );

I think problem in targetNamespace param

thanks in advance

mradcliffe’s picture

There was a pretty big change made to Services API RC4 from RC3 so things might be broken with Services now

marcus_clements’s picture

I have comitted the patch - thanks mradcliffe.
Also fixed the issue in #30 and fixed the test script.
Development and Alpha1 releases should appear on the project page tonight.

marcus_clements’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Assigned: Unassigned » marcus_clements
Status: Needs review » Fixed
smartango’s picture

http://localhost/soap/test?wsdl
I got this:

Fatal error: Call to undefined function services_get_all() in /www/sites/all/modules/soap_server/soap_server.module on line 164

I tried to install services 7.x-3.0-rc3, rc5, rc4, I have the same problem for all version

Undefined function look as an api change, what version of services is compatible?

UPDATE:
I was using 3.0-alpha1 release which is not the real porting, using the package sent here it works

mradcliffe’s picture

Status: Fixed » Needs work

It actually looks like not all of the changes were committed in that commit, @rayvaughn. I'll take a look at it here shortly.

mradcliffe’s picture

Status: Needs work » Needs review
StatusFileSize
new30.85 KB

Here's a quick one without a rebase, which resulted in about 4 or so patches. I tested the patch with git am 0001-1129282-by-mradcliffe.-Further-fix-of-7.x-3.x-branch.patch and it applied to a clean git checkout -b 7.x-3.x origin/7.x-3.x.

The soap server I have setup responds appropriately with Services 3.x RC3 (I do not use RC4/RC5 because of a critical (normal) bug that log out a currently logged in user).

marcus_clements’s picture

Are you sure this against 7.x-3.x-dev? I looks like a patch against an old 6.x version? It's not you - it's me! :-/ I must have borked the commit and push... Will fix...

hllvd’s picture

my soap_server shows the same error...

Fatal error: Call to undefined function services_get_all() in /www/sites/all/modules/soap_server/soap_server.module on line 164

when I select XMLRPC or Rest this works well but fail when i select soap server

Can anyone help me please??????? I'm building a website that i need soap for integrate with other one...this is so important to me

I have been used the patch above but still the same

thanks

FranciscoLuz’s picture

@hllvd

It seems to me that you haven't applied the patch from #36.

FranciscoLuz’s picture

Hi,

Notice: Use of undefined constant ServicesSoapServer - assumed 'ServicesSoapServer' in soap_server_server() (line 102 of .../sites/all/modules/soap_server/soap_server.module).

Steps to reproduce the above Notice:

  1. Apply patch from #36
  2. Add an end point at admin/structure/services/add
  3. Open up a new tab in your browser and access your endpoint, say for example http://localhost/myendpoint?WSDL
  4. Get back on the previous browser tab and refresh the page. You should see the Notice message by now.

I am not sure if ServicesSoapServer was really meant to be a constant or the wrap up quotes were simply forgotten. For me the latter one seems to be the case, so I have rolled a patch. Please test it.

You must apply the patch from #36 b4 applying this one.

mradcliffe’s picture

@FranciscoLuz: This is also an issue with the 6.x-3.x-dev branch iirc.

FranciscoLuz’s picture

@mradcliffe

You are right. I just opened an issue for 6.x-3.x-dev branch at http://drupal.org/node/1285192 and rolled a patch there as well.

marcus_clements’s picture

I have finally found the time to patch and commit the patches from this thread. Thanks to mradcliffe and FranciscoLuz.
Please update and review if you get the chance.

mradcliffe’s picture

Great, thanks rayvaughn. I tested alpha2 just now and it's working.

An update on testing in general. I have had successful SOAP tests coming from WebSphere, but not in production yet. That really isn't anything to do with Drupal, but more to do with WebSphere. I am still using Services 3.0-rc3 so if someone else could test soap_server-alpha2 with Services 3.0 that would be great.

marcus_clements’s picture

Status: Needs review » Reviewed & tested by the community

The simpletest works in RC5.

marcus_clements’s picture

Status: Reviewed & tested by the community » Closed (fixed)

I'm going to close this thread - any bugs in alpha2 do start a new issue