Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validating Request Against a WSDL

Status
Not open for further replies.

relytjj

Technical User
Jan 26, 2007
3
US
I'm attempting to build a client side for a quoting web service. The third party who maintains the server side has provided a WSDL in paper form but hasn't hosted it on the web. I'm using php and nusoap to develop the client. I can't initilise my soapclient with the WSDL and am received error messages that don't give me a lot of information about what I'm doing wrong.

The WSDL is:

<?xml version="1.0" encoding="UTF-8" ?>
<definitions name="PriceQuoteService" targetNamespace=" xmlns=" xmlns:ns2=" xmlns:soap=" xmlns:tns=" xmlns:xsd="<types>
<schema targetNamespace=" xmlns=" xmlns:soap11-enc=" xmlns:tns=" xmlns:wsdl=" xmlns:xsi=" <import namespace=" />
<complexType name="LocalAccessDomain">
<sequence>
<element name="bandwidth" type="string" />
<element name="city" type="string" />
<element name="customerName" type="string" />
<element name="litBldgFlag" type="boolean" />
<element name="state" type="string" />
<element name="street" type="string" />
<element name="term" type="short" />
<element name="zip" type="string" />
<element name="zip4" type="string" />
</sequence>
</complexType>
<complexType name="LocalAccessPrice">
<sequence>
<element name="message" type="string" />
<element name="nonRecurringPrice" type="double" />
<element name="quoteId" type="long" />
<element name="recurringPrice" type="double" />
<element name="statusCode" type="string" />
</sequence>
</complexType>
</schema>
</types>
<message name="PQSService_calculatePricesResponse">
<part name="result" type="ns2:LocalAccessPrice" />
</message>
<message name="PQSService_calculatePrices">
<part name="LocalAccessDomain_1" type="ns2:LocalAccessDomain" />
</message>
<portType name="PQSService">
<operation name="calculatePrices" parameterOrder="LocalAccessDomain_1">
<input message="tns:pQSService_calculatePrices" />
<output message="tns:pQSService_calculatePricesResponse" />
</operation>
</portType>
<binding name="PQSServiceBinding" type="tns:pQSService">
<soap:binding style="rpc" transport=" />
<operation name="calculatePrices">
<soap:eek:peration soapAction="" />
<input>
<soap:body encodingStyle=" namespace=" use="encoded" />
</input>
<output>
<soap:body encodingStyle=" namespace=" use="encoded" />
</output>
</operation>
</binding>
<service name="PriceQuoteService">
<port binding="tns:pQSServiceBinding" name="PQSServicePort">
<soap:address location=" />
</port>
</service>
</definitions>


My request to the webservice is:

<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle=" xmlns:SOAP-ENV=" xmlns:xsd=" xmlns:xsi=" xmlns:SOAP-ENC=" xmlns:ns1303=" xsi:type="xsd:string">DS-1</bandwidth><city xsi:type="xsd:string">Fairfield</city><customerName xsi:type="xsd:string">Test Customer</customerName><litBldgFlag xsi:type="xsd:string">Y</litBldgFlag><state xsi:type="xsd:string">OH</state><street xsi:type="xsd:string">1252 Main St</street><term xsi:type="xsd:string">12</term><zip xsi:type="xsd:string">45014</zip><zip4 xsi:type="xsd:string">5556</zip4></LocalAccessDomain></ns1303:calculatePrices></SOAP-ENV:Body></SOAP-ENV:Envelope>


The message back from the server is:

soapenv:Client
java.lang.IllegalArgumentException

I am assuming that the issue is with my request xml and not with the arguments to the API function.

Anyone have any ideas?
 
Here is the structure Stylus Studio derives from your WSDL.
Code:
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] 
				    xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] 
					xmlns:soapenc="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/"[/URL] 
					xmlns:SOAP-ENV="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/">[/URL]
	<SOAP-ENV:Body>
		<ns1:calculatePrices xmlns:ns1="[URL unfurl="true"]http://pqs.ws.jboss.org/">[/URL]
			<LocalAccessDomain_1>
				<bandwidth/>
				<city/>
				<customerName/>
				<litBldgFlag/>
				<state/>
				<street/>
				<term/>
				<zip/>
				<zip4/>
			</LocalAccessDomain_1>
		</ns1:calculatePrices>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Maybe you can change the element name as indicated...

Tom Morrison
 
Thanks, I'll give that a try and see how it turns out.
 
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/"[/URL] xmlns:SOAP-ENV="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/"[/URL] xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xmlns:SOAP-ENC="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/encoding/">[/URL]
<SOAP-ENV:Body>
<ns4265:calculatePrices xmlns:ns4265="[URL unfurl="true"]http://pqs.ws.jboss.org">[/URL]
<LocalAccessDomain_1>
<bandwidth xsi:type="xsd:string">DS-1</bandwidth>
<city xsi:type="xsd:string">Fairfield</city>
<customerName xsi:type="xsd:string">Test Customer</customerName>
<litBldgFlag xsi:type="xsd:string">Y</litBldgFlag>
<state xsi:type="xsd:string">OH</state>
<street xsi:type="xsd:string">100 Commercial Dr</street>
<term xsi:type="xsd:string">12</term>
<zip xsi:type="xsd:string">45014</zip>
<zip4 xsi:type="xsd:string">5556</zip4>
</LocalAccessDomain_1>
</ns4265:calculatePrices>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I'm still recieving the same error.

soapenv:Client
java.lang.IllegalArgumentException

I'm hoping to just make sure that it isn't an xml or soap fault. Then I can go back to the third party and request more documentation on the arguments for the API.
 
I would expect the web service provider to have logs and other diagnostic tools to be able to tell you why this message is being returned.

Another question: is this reponse in the form of a SOAP fault? If not, what is the form of the HTTP response payload?

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top