473,320 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

WSDL-SoapClient

Hi All,

I am i into php webservices development i have to
access a WSDL file from client to a proxyservice(ALSB- AquaLogic)
while generating request XML format type input is given to Soap.
In that one namespace is being refered to another one namespace.
dependency kinda thing, there a namespace is not being mapped to the
referring namespace.
Suggest me whether i am using corect way or thr is another work around.

Pls do help me.

TIA,
Nov 7 '06 #1
3 4500
vssp
268 100+
Hai friend

I am not clear Please can u expline breifly


vssp
Nov 7 '06 #2
Hai friend

I am not clear Please can u expline breifly


vssp

Hai,

First thanks for your humble reply.

The problem which im facing is as follows:

given below are complet set of code....

hope ull hav a very good undetstanding by now.

Issue #1 : namespaces are not being mapped properly.

Issue #2 : If namespaces are mapped then the attribute "elementFormDefault" must be added.

Needed Result : Without any change in WSDL by coding in PHP need to solve this problem.

Anticipating ur fav reply.




MyClient.php
<?php
include('myResponse.php');
include('MyRequest.php');

$myResponse = new myResponse();

$MyRequest = new MyRequest();

$MyRequest->CustomerNumber = 123;
$MyRequest->Unit = 'ABC';

$myResponse ->MyRequest= $MyRequest;

$client = new SoapClient('http://localhost/MyLocalProxy?WSDL',array('trace'=>1));
try{
$response = $client->myResponse($myResponse);
$error = $response->MyResponse->error;
echo "Error Code ".$error->ErrorCode."<br>";
echo "Error Message ".$error->ErrorMessage."<br>";
} catch (SoapFault $e) {
echo $e;
}

echo "Last request Headers".$client->__getLastRequest()."<br>";
echo "Last request ".$client->__getLastRequest()."<br>";
echo "Last response <xmp>\n".
$client->__getLastResponse()."</xmp><br><br>";

?>


XML Request
Required XML Request
Following is the required XML request by the server before changing WSDL. Element MyRequest is mapped with ns1 namespace.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://abc.com/GBTSTo/GBTSTReq/01" xmlns:ns2="http://abc.com/GBTST">
<SOAP-ENV:Body>
<ns2:gBlTST>
<ns1:GSTBTReq>
<CustomerNumber>123</CustomerNumber>
<Unit>ABC</Unit>
</ns1:GSTBTReq>
</ns2:gBlTST>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Generated XML Request before changing WSDL
This is the XML request generated by the above PHP client code before changing the WSDL i.e. before adding elementFormDefault="qualified" in WSDL schema. Element GSTBTReq doesn’t contain namespace which causes ALSB[AquaLogicServiceBus] validation to fail.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://abc.com/GBTST">
<SOAP-ENV:Body>
<ns1:gBTST>
<GSTBTReq> <!— TODO : namespace not mapped here -- >
<CustomerNumber>45</CustomerNumber>
<Unit>DEF</Unit>
</GSTBTReq>
</ns1:gBTST>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Generated XML Request after changing WSDL

This is the XML request generated by the above PHP client code after changing the WSDL ie after adding elementFormDefault="qualified" in WSDL schema. Element GSTBTReq is now mapped with ns1 namespace. This input also gets the response from the server with no ALSB validation fail.


<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://abc.com/GBTST/GBTSTReq/01" xmlns:ns2="http://abc.com/GBTST">
<SOAP-ENV:Body>
<ns2:gBTST>
<ns1:GSTBTReq>
<ns1:CustomerNumber>576</ns1:CustomerNumber>
<ns1:Unit>US</ns1:Unit>
<ns1:GSTBTReq>
</ns2:gBTST>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>



Change in WSDL

Following wsdl block is part of GBTST WSDL file. Attribute elementFormDefault="qualified" is added to the second schema which is required to generate required XML input.

<s:schema elementFormDefault="qualified" targetNamespace="http://abc.com/GBTST" xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
<s:import namespace="http://abc.com/GBTST/GBTSTReq/01"/>
<s:import namespace="http://abc.com/GBTST/GBTSTResp/01"/>
<s:element name="gBTST">
<s:complexType>
<s:sequence>
<s:element ref="ns:GSTBTReq"/><!— TODO : element defined in other schema for which namespace is not mapped in the request -->
</s:sequence>
</s:complexType>
</s:element>
<s:element name= "gBTSTResp">
<s:complexType>
<s:sequence>
<s:element ref="ns1:GSTBTResp"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>

<!— TODO : Added attribute elementFormDefault="qualified" to solve the problem -- >

<s:schema elementFormDefault="qualified" targetNamespace="http://abc.com/GBTST/GBTSTReq/01" xmlns:common="http://abc.com/Common/01" xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:req="http://abc.com/GBTST/GBTSTReq/01" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<s:import namespace="http://abc.com/Common/01"/>
<s:simpleType name="CustomerNumber">
<s:restriction base="xsd:integer"/>
</s:simpleType>
<s:simpleType name="Unit">
<s:restriction base="xsd:string">
<s:enumeration value="ABC"/>
</s:restriction>
</s:simpleType>
<s:element name="GSTBTReq">
<s:complexType>
<s:sequence>
<s:element name="CustomerNumber" nillable="false" type="req:CustomerNumber"/>
<s:element name="Unit" nillable="false" type="req:OperatingUnit"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>





Thanks in Advance ...
Nov 13 '06 #3
ronverdonk
4,258 Expert 4TB
This the second notice:

Read the Posting Guidelines before you put anything in here. Take special notice of the part saying that you must enclose you code within code, php or html tags.!!


Ronald :cool:
Nov 14 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: Generic Usenet Account | last post by:
Does anyone have an opinion on how IDL and WSDL compare to each other? Are they equally powerful in their "expressive power"? Sometimes it appears to me that IDL is a little easier for humans to...
5
by: relaxedrob | last post by:
Hi All! I ran the following w3c example through my WSDL parser (SOA Editor from Cape Clear): http://www.w3.org/TR/wsdl#_rpcexample It told me that there were a bunch of erros about no...
1
by: ffhansix | last post by:
Hi, I am having problems with generating a c# proxy class from a IBM websphere WSDL file, when running the wsdl.exe to create the c# proxy file command i recieve an error: Warning: one or...
0
by: saish | last post by:
Hello I am new to vb.net webservice. My requirement is to design a VB.net web service which will send and receive xml documents. The xml document send and received would be a very complex .xsd...
0
by: Elhanan | last post by:
hi.. i have a small Web Service which is consumed by dotnet application the webservice is located in 2 places. the first is my local tomcat, and the second is in websphere server. problems is...
6
by: Naveed Anwar | last post by:
how a tcp server running on given uri like "soap:tcp://localhost:8080/MyReceiver" will return wsdl. In normal web service case which runs on http returns wsdl by simply appending '?wsdl' in url,...
1
by: Mike Logan | last post by:
I have a schema that defines my messages and objects. I then have a WSDL that defines the web services. I have my sample XSD, sample WSDL, and the code generated from WSDL.exe. In the generated...
9
by: Cesar | last post by:
Hello there, A java programmer sent me a wsdl file, which I have to use to consume his web methods. When I run the wsld.exe tool to generate the class' code, I get the following message: ...
3
by: Siva | last post by:
Hi all, I want to Convert a WSDL to a SOAP message. Is there any way to do this. I am using .NET 2.0 Thanks in Advance Siva
5
by: Nick K. | last post by:
I use wsdl.exe to generate client code to call a web service. The actual web service is generated with the BizTalk Web Services Publishing Wizard. I'm not sure this is particular to the BizTalk...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.