• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

WSDL issues

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a wsdl that I just want to send a 2 parameters(invoiceID and invoiceNumber). When I use the WSDLtoJava tool, it generates the java fine. When I view the service in Axis, it gives me a ton of methods. Looks like: I should just say getPurchaseOrder. See my WSDL below. Please help...

PurchaseOrder (wsdl)
getPurchaseOrderAddress
getPurchaseOrder
getPurchaseOrder
getPort
getPort etc.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://jstc1364:8080/axis/services/PurchaseOrder" xmlns:impl="http://jstc1364:8080/axis/services/PurchaseOrder" xmlns:intf="http://jstc1364:8080/axis/services/PurchaseOrder" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Created using Cape Clear Studio SOA Editor - http://www.capeclear.com</wsdl:documentation>
<wsdl:message name="PurchaseOrderRequest">
<wsdl:part name="invoiceID" type="xsd:integer"/>
<wsdl:part name="invoiceNumber" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="PurchaseOrderResponse">
<wsdl:part name="invoiceIDReturn" type="xsd:integer" />
<wsdl:part name="invoiceNumberReturn" type="xsd:integer" />
</wsdl:message>
<wsdl:portType name="PurchaseOrder">
<wsdl:operation name="GetPurchaseOrders">
<wsdl:input name="PurchaseOrderRequest" message="impl:PurchaseOrderRequest"/>
<wsdl:output name="PurchaseOrderResponse" message="impl:PurchaseOrderResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PurchaseOrderBinding" type="impl:PurchaseOrder">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetPurchaseOrders">
<wsdlsoap:operation
soapAction=""/>
<!-- <wsdl:input>
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:body use="literal"/>
</wsdl:output>-->
<wsdl:input name="PurchaseOrderRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://purchaseOrder" />
</wsdl:input>
- <wsdl:output name="PurchaseOrderResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/services/PurchaseOrder" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="PurchaseOrder">
<wsdl:port binding="impl:PurchaseOrderBinding" name="PurchaseOrder">
<wsdlsoap:address location="http://jstc1364:8080/axis/services/PurchaseOrder"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you think that that's what you ought to do, then why don't you? That is to say: is there a question somewhere in your post?
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I meant to say in my post.. I want it to just say getPurchaseOrder instead of all the other methods. What I am doing wrong because I get all those other methods when I access my webservices in AXIS?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The methods that are exposed as WS are specified in the deployment descriptor. You should be able simply to remove the corresponding <operation> elements in your WSDD file, and then, after the next deployment, they should no longer be in the WSDL.
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. I fixed the WSDL and it does work and I can deploy it, but I can't get a SOAP response. I get:
<faultstring>java.lang.InstantiationException:
localhost.axis.services.PurchaseOrderService.PurchaseOrder</faultstring>

I also see this error in my XML:

SeverityDescriptionResourceIn FolderLocationCreation TimeId
2cvc-complex-type.2.4.a: Invalid content was found starting with element 'types'. One of '{"http://schemas.xmlsoap.org/wsdl/" ocumentation, WC[##other:"http://schemas.xmlsoap.org/wsdl/"], "http://schemas.xmlsoap.org/wsdl/":import, "http://schemas.xmlsoap.org/wsdl/":types, "http://schemas.xmlsoap.org/wsdl/":message, "http://schemas.xmlsoap.org/wsdl/" ortType, "http://schemas.xmlsoap.org/wsdl/":binding, "http://schemas.xmlsoap.org/wsdl/":service}' is expected.
@see: http://www.w3.org/TR/xmlschema-1/#cvc-complex-typepurchaseOrder.wsdlaxisline 4November 5, 2005 4:47:55 PM1483

Can someone give me a idea of what might be wrong? Thanks
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My WSDL:
<?xml version="1.0"?>
<wsdl efinitions targetNamespace="http://localhost:8080/axis/services/PurchaseOrderService" xmlns:typens="http://localhost:8080/axis/services/PurchaseOrderService" xmlns:impl="http://localhost:8080/axis/services/PurchaseOrderService" xmlns:intf="http://localhost:8080/axis/services/PurchaseOrderService" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

<types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://localhost:8080/axis/services/PurchaseOrderService" elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xsd:complexType name="PurchaseOrderResult">
<xsd:all>
<xsd:element name="purchaseOrderID" type="xsd:integer"/>
<xsd:element name="invoiceNumber" type="xsd:string"/>
<xsd:element name="first"/>
<xsd:element name="last"/>
<xsd:element name="address"/>
<xsd:element name="city"/>
<xsd:element name="zip"/>
<xsd:element name="country"/>
<xsd:element name="invoiceDate" type="xsd:string"/>
<xsd:element name="discount" type="xsd:string"/>
<xsd:element name="shipTo" type="xsd:string"/>
<xsd:element name="billTo" type="xsd:string"/>
<xsd:element name="lineItemID" type="xsd:string"/>
<xsd:element name="quanitity" type="xsd:string"/>
<xsd:element name="unitCost" type="xsd:string"/>
<xsd:element name="comments" type="xsd:string"/>
<xsd:element name="tax" type="xsd:string"/>
<xsd:element name="totalCost" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
</types>

<wsdl:message name="PurchaseOrderRequest">
<wsdl :p art name="invoiceID" type="xsd:integer"/>
</wsdl:message>
<wsdl:message name="PurchaseOrderResponse">
<wsdl :p art name="return" type="typens :p urchaseOrderResult" />
</wsdl:message>

<wsdl :p ortType name="PurchaseOrder">
<wsdl peration name="GetPurchaseOrders">
<wsdl:input name="PurchaseOrderRequest" message="impl :p urchaseOrderRequest"/>
<wsdl utput name="PurchaseOrderResponse" message="impl :p urchaseOrderResponse"/>
</wsdl peration>
</wsdl :p ortType>

<wsdl:binding name="PurchaseOrderSoapBinding" type="impl :p urchaseOrder">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl peration name="GetPurchaseOrders">
<wsdlsoap peration soapAction=""/>
<wsdl:input name="PurchaseOrderRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://purchaseorder" />
</wsdl:input>
<wsdl utput name="PurchaseOrderResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/services/PurchaseOrder" />
</wsdl utput>
</wsdl peration>
</wsdl:binding>

<wsdl:service name="PurchaseOrderService">
<wsdl :p ort binding="impl :p urchaseOrderSoapBinding" name="PurchaseOrder">
<wsdlsoap:address location="http://localhost:8080/axis/services/PurchaseOrderService"/>
</wsdl :p ort>
</wsdl:service>
</wsdl efinitions>
[ November 05, 2005: Message edited by: Matt Hoffman ]
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The reason for my previous error is that <types> should be <wsdl:types>. Now I am not sure how to invoke this and get a SOAP response. This is the request, but I get a java.lang.InstantiationException. What do I need to do to get a response?

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<oxy:GetPurchaseOrders xmlns:oxy="http://purchaseorder">
<invoiceID>1111</invoiceID>
</oxy:GetPurchaseOrders>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How is this request created - did you put it together manually? (I ask because, not seeing the client code, and not knowing where the exception is thrown, I assume that the SOAP is incorrect, although there can be other reasons.). An API like SAAJ can help with only a few lines of code; this article shows how.
[ November 06, 2005: Message edited by: Ulf Dittmer ]
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. I am getting the exception when sending the soap request. I guess this is my question. I am not using a DB or anyhing. I just need to send a request that sends a invoiceID and receives header and line item info for 1 invoice. I would be passing the invoiceID via a client in the command line and then getting a SOAP request and response. THis seems so simple, but I am getting this in the response. Any ideas you may have will be helpful on how to do a "static" request and response.

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>java.lang.InstantiationException:
localhost.axis.services.PurchaseOrderService.PurchaseOrder</faultstring>
<detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">JSTC1364</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic