-
Jul 18th, 2008, 03:55 AM
#1
problem with consuming webservice
I am trying to consume the webservice developed in aldsp 3.0.
I am using spring WebServiceTemplate and WebServiceMessageCallback for consuming.
My code is
<code>
SampleRequestDocument req=.....
WebServiceTemplate template=new WebServiceTemplate();
template.setMarshaller(new XmlBeansMarshaller());
template.setUnmarshaller(new XmlBeansMarshaller());
template.setDefaultUri("http://....");
WebServiceMessageCallbackImpl wmc=new WebServiceMessageCallbackImpl();
try
{
Object obj=template.marshalSendAndReceive(req, wmc);
}
WebServiceMessageCallbackImpl
public void doWithMessage(WebServiceMessage message) throws IOException,
TransformerException {
SoapMessage message1=(SoapMessage)message;
message1.setSoapAction("getReferenceData");
}
my wsdl
<?xml version="1.0" encoding="UTF-8" ?>
- <definitions targetNamespace="ld:ws/ReferenceDataws.ws" name="ReferenceDataws" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="ld:ws/ReferenceDataws.ws" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<documentation>AquaLogic Data Services Web Service</documentation>
- <types>
- <xs:schema targetNamespace="ld:ws/ReferenceDataws.ws" elementFormDefault="qualified" xmlns:stns="ld:ws/ReferenceDataws.ws" xmlns:dsns0="http://ness.com/schema">
<xs:import namespace="http://ness.com/schema" />
- <xs:element name="getReferenceData">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="arg0">
- <xs:complexType>
- <xs:sequence>
<xs:element ref="dsns0:SearchReferenceDataRequest" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getReferenceDataResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element ref="dsns0:SearchReferenceDataResponse" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
- <xs:schema targetNamespace="ld
hysical/IssuerPhysical">
- <xs:element name="IssuerPhysical">
- <xs:complexType>
- <xs:sequence>
<xs:element name="_x0028_TRIM_x0028_INDUSTRY_CODE_x0029__x0029 _" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
- <xs:schema targetNamespace="http://ness.com/schema" elementFormDefault="qualified" xmlns:sp="http://ness.com/schema">
- <xs:element name="SearchReferenceDataRequest">
- <xs:complexType>
- <xs:sequence>
<xs:element name="SearchReferenceDataDetails" type="sp:SearchReferenceDataType" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="SearchReferenceDataResponse">
- <xs:complexType>
- <xs:sequence>
<xs:element name="SearchReferenceDataDetails" type="sp:SearchReferenceDataDetailsType" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:complexType name="SearchReferenceDataType">
- <xs:sequence>
<xs:element name="requestType" type="xs:string" />
</xs:sequence>
</xs:complexType>
- <xs:complexType name="SearchReferenceDataDetailsType">
- <xs:sequence>
<xs:element name="IssuerStatuss" type="sp:IssuerStatusTypeObject" />
<xs:element name="Industrys" type="sp:IndustryTypeObject" />
<xs:element name="ExclusionFlags" type="sp:ExclusionFlagTypeObject" />
</xs:sequence>
</xs:complexType>
- <xs:complexType name="IssuerStatusTypeObject">
- <xs:sequence>
<xs:element ref="sp:IssuerStatus" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
- <xs:element name="IssuerStatus">
- <xs:complexType>
- <xs:sequence>
<xs:element name="IssuerStatusId" type="xs:string" />
<xs:element name="IssuerStatusName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:complexType name="IndustryTypeObject">
- <xs:sequence>
<xs:element ref="sp:Industry" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
- <xs:element name="Industry">
- <xs:complexType>
- <xs:sequence>
<xs:element name="IndustryId" type="xs:string" />
<xs:element name="IndustryName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:complexType name="ExclusionFlagTypeObject">
- <xs:sequence>
<xs:element ref="sp:ExclusionFlag" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
- <xs:element name="ExclusionFlag">
- <xs:complexType>
- <xs:sequence>
<xs:element name="ExclusionFlagId" type="xs:string" />
<xs:element name="ExclusionFlagName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</types>
- <message name="getReferenceDataIn">
<part name="parameters" element="tns:getReferenceData" />
</message>
- <message name="getReferenceDataOut">
<part name="parameters" element="tns:getReferenceDataResponse" />
</message>
- <portType name="ReferenceDatawsPT">
- <operation name="getReferenceData">
<input message="tns:getReferenceDataIn" />
<output message="tns:getReferenceDataOut" />
</operation>
</portType>
- <binding name="ReferenceDatawsSoapBinding" type="tns:ReferenceDatawsPT">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="getReferenceData">
<soap:operation soapAction="ld:ws/ReferenceDataws.ws/getReferenceData" style="document" />
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
</binding>
- <service name="ReferenceDatawsSoapService">
- <port binding="tns:ReferenceDatawsSoapBinding" name="ReferenceDatawsSoapPort">
<soap:address location="http://192.168.24.128:7001/DR2/ALDSPWebService/ws/ReferenceDataws.ws" />
</port>
</service>
</definitions>
</code>
when i run my webserviceclient i am getting the following exception
<code>
org.springframework.ws.client.WebServiceTransportE xception: Method Not Allowed [405]
at org.springframework.ws.client.core.WebServiceTempl ate.handleError(WebServiceTemplate.java:483)
at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:408)
at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 265)
at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 253)
at Test1.main(Test1.java:45)
</code>
In my webservice i have one method getReferenceData with SampleRequestDocumentas parameter .
Please try to help me in this regard...
-
Jul 21st, 2008, 02:05 PM
#2
Hi,
It looks like you have a problem with your end point URI , have you try to use your soap:address's location URI ...?
I'm not sure about your problem , as a suggestion please refer "endpoint mapping" section in the user guide [section 5.5] and try to do some modifications.
If you have any further issues please post with your spring-ws-servlet.xml configuration file, It will help someone to figure out your problem.
-
Jul 22nd, 2008, 02:05 AM
#3
Thanks for giving reply.what ever you are expecting is correct.I have changed the endpoint.now i am getting some other exception.
I don't have any spring configuration files.because the service is developed in aldsp.
I am using xmlbeans to construct the request.
the formated request doc is
<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>
<sch:SearchReferenceDataRequest xmlns:sch="http://ness.com/schema">
<sch:SearchReferenceDataDetails>
<sch:requestType>ALL</sch:requestType>
</sch:SearchReferenceDataDetails>
</sch:SearchReferenceDataRequest>
</soapenv:Body>
expected request is
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<getReferenceData xmlns="ld:ws/ReferenceDataWS.ws" xmlns:sch="http://ness.com/schema">
<arg0>
<sch:SearchReferenceDataRequest>
<sch:SearchReferenceDataDetails>
<sch:requestType>string</sch:requestType>
</sch:SearchReferenceDataDetails>
</sch:SearchReferenceDataRequest>
</arg0>
</getReferenceData>
</soapenv:Body>
</soapenv:Envelope>
getReferenceData is operation is wsdl
and SearchReferenceDataRequest is the argument of that method.
how can i call the operation is the webservice???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules