I have a webservice project (WebServiceProject2) and I want to call a method in EJB project (BelsizeEJB).
I have done the following: Right-click WebServiceProject2 -> Build Path -> Configure Build Path -> Projects tab -> Add -> BelsizeEJB -> OK
Login.java in BelsizeEJB project
package com.belsize.module;
public class Login {
public boolean loginuser(String User, String Password) {
String LOC = "Login: loginUser";
System.out.println(LOC);
return true;
}
}
Authenticate.java in WebServiceProject2
package com.myeclipseide.ws;
import com.belsize.module.Login;
public class Authenticate {
public boolean doLogin_loginAction(String User, String Password) {
System.out.println("Testing Start");
Login _l = new Login();
System.out.println("Login Method Result: " + _l.loginuser(User, Password));
System.out.println("Testing End");
return _l.loginuser(User, Password);
}
}
After done the above mentioned, I had Create a new web service and generate the wsdl as followed:
Authenticate.wsdl
<wsdl:message name="doLogin_loginActionResponse">
<wsdl:part element="impl:doLogin_loginActionResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="doLogin_loginActionRequest">
<wsdl:part element="impl:doLogin_loginAction" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="loginRequest">
<wsdl:part element="impl:login" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="loginResponse">
<wsdl:part element="impl:loginResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="Authenticate_SEI">
<wsdl:operation name="login">
<wsdl:input message="impl:loginRequest" name="loginRequest">
</wsdl:input>
<wsdl:output message="impl:loginResponse" name="loginResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="doLogin_loginAction">
<wsdl:input message="impl:doLogin_loginActionRequest" name="doLogin_loginActionRequest">
</wsdl:input>
<wsdl:output message="impl:doLogin_loginActionResponse" name="doLogin_loginActionResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AuthenticateSoapBinding" type="impl:Authenticate_SEI">
<wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsdl:required="false"/>
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="login">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="loginRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="loginResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="doLogin_loginAction">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="doLogin_loginActionRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="doLogin_loginActionResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AuthenticateService">
<wsdl:port binding="impl:AuthenticateSoapBinding" name="Authenticate">
<wsdlsoap:address location="http://localhost:9081/WebServiceProject2/services/Authenticate"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
However when I try to invoke a wsdl operation, I encountered the following error:
[6/4/13 15:54:36:006 SGT] 000000b7 SystemOut O Testing Start
[6/4/13 15:54:36:010 SGT] 000000b7 WebServicesSe E com.ibm.ws.webservices.engine.transport.http.WebServicesServlet doPost WSWS3227E: Error: Exception:
WebServicesFault
faultCode: Server
faultString: Internal Error
faultActor: null
faultDetail:
Internal Error
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.bindExceptionToResponse(PivotHandlerWrapper.java:531)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:353)
at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invoke(JAXRPCHandler.java:153)
at com.ibm.ws.webservices.engine.handlers.WrappedHandler.invoke(WrappedHandler.java:64)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:264)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:264)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:336)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServlet.doPost(WebServicesServlet.java:1153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServletBase.service(WebServicesServletBase.java:344)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1225)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:775)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:457)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1032)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:908)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:166)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1691)
SOAP Response Envelope:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>Internal Error</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Much appreciate for your response.
Thanks.
The error message seems similar to this:
JAX-WS server-side SOAPHandler that returns fault gets "Internal Error" on WebSphere v8
According to IBM:
When webservices.unify.faults is set to "true", the runtime exception
thrown by the application code is unified, and the client will receive
a SOAP fault message indicating "Internal Error".
The fix for this APAR is currently targeted for inclusion in fix packs
7.0.0.25 and 8.0.0.4. Please refer to the Recommended Updates page for delivery information:
http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Perhaps you could update your version of WebSphere to at least 8.0.0.4?
Related
I am trying to register a WSDL in policy studio under location:
Business Services > Web Service Repository > Web Service
but while registering I am getting this error:
Couldn't Generate WSFilter
I also validated the WSDL through WS-i basic profile and the result was passed.
Kindly help me to resolve the issue.
Here is the WSDL that I am trying to register:
<wsdl:definitions xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:client="http://xmlns.oracle.com/Test_SOA_Service/Test_SOA_Service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="Test_SOA_Service" targetNamespace="http://xmlns.oracle.com/Test_SOA_Service/Test_SOA_Service">
<wsdl:documentation>
<abstractWSDL>
http://soadev1.cp.np.com:1234/soa-infra/services/Test_SOA_Service!1.0/Test_SOA_Service.wsdl
</abstractWSDL>
</wsdl:documentation>
<plnk:partnerLinkType name="Test_SOA_Service">
<plnk:role name="Test_SOA_ServiceProvider">
<plnk:portType name="client:Test_SOA_Service"/>
</plnk:role>
</plnk:partnerLinkType>
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xmlns.oracle.com/Test_SOA_Service/Test_SOA_Service" schemaLocation="http://soadev1.cp.np.com:1234/soa-infra/services/Test_SOA_Service/test_soa_service_client_ep?XSD=xsd/Test_SOA_Service.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="Test_SOA_ServiceRequestMessage">
<wsdl:part name="payload" element="client:process"/>
</wsdl:message>
<wsdl:message name="Test_SOA_ServiceResponseMessage">
<wsdl:part name="payload" element="client:processResponse"/>
</wsdl:message>
<wsdl:portType name="Test_SOA_Service">
<wsdl:operation name="process">
<wsdl:input message="client:Test_SOA_ServiceRequestMessage"/>
<wsdl:output message="client:Test_SOA_ServiceResponseMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Test_SOA_ServiceBinding" type="client:Test_SOA_Service">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="process">
<soap:operation style="document" soapAction="process"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="test_soa_service_client_ep">
<wsdl:port name="Test_SOA_Service_pt" binding="client:Test_SOA_ServiceBinding">
<soap:address location="http://soadev1.cp.np.com:1234/soa-infra/services/Test_SOA_Service/test_soa_service_client_ep"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I found the answer. Vordel is configured in such a way that can hit only OSB services. Here i am trying to hit the BPEL service.
I have created a web service using Axis2 and I want to change the Content-type of my response from text/xml; charset=UTF-8 to text/xml; charset=utf-8.
Only when I send the Content-type as text/xml; charset=utf-8 in request header, it returns corretly. But in my case, I don't have that flexibility. So, I need to find a way to change th default Content-Type to text/xml; charset=utf-8.
Can some one give an idea on how to change this?
I have tried below like options but no any luck.
WSDL :
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="GradeTenMathService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<xs:schema>
<xs:import namespace="http://tempuri.org/" schemaLocation="Math.xsd"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="AdditionResponse">
<wsdl:part name="AdditionRS" element="tns:AdditionResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="AdditionRequest">
<wsdl:part name="AdditionRQ" element="tns:AdditionRequest">
</wsdl:part>
</wsdl:message>
<wsdl:message name="DevisionResponse">
<wsdl:part name="DevisionRS" element="tns:DevisionResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="DevisionRequest">
<wsdl:part name="DevisionRQ" element="tns:DevisionRequest">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="GradeTenMathPortType">
<wsdl:operation name="Addition">
<wsdl:input message="tns:AdditionRequest">
</wsdl:input>
<wsdl:output message="tns:AdditionResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Devision">
<wsdl:input message="tns:DevisionRequest">
</wsdl:input>
<wsdl:output message="tns:DevisionResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="GradeTenMathBinding" type="tns:GradeTenMathPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Addition">
<soap:operation soapAction="Addition" style="document"/>
<wsdl:input>
<mime:content part="Addition" type="text/xml; charset=utf-8"/>
</wsdl:input>
<wsdl:output>
<mime:content part="Addition" type="text/xml; charset=utf-8"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Devision">
<soap:operation soapAction="Devision" style="document"/>
<wsdl:input>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="GradeTenMath">
<wsdl:port name="GradeTenMathPort" binding="tns:GradeTenMathBinding">
<soap:address location="http://localhost:8081/axis2/services/GradeTenMath"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I started learning Web Services. I wrote my first piece of code from the example that was given in the book. But when i run it, it does not behanve the way its supposed to! I see the wsdl file generated and see the error:
My WSDL file is:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ts.ch01" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://ts.ch01" xmlns:intf="http://ts.ch01" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://ts.ch01" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="getTimeAsString">
<complexType/>
</element>
<element name="getTimeAsStringResponse">
<complexType>
<sequence>
<element name="getTimeAsStringReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getTimeAsElapsed">
<complexType/>
</element>
<element name="getTimeAsElapsedResponse">
<complexType>
<sequence>
<element name="getTimeAsElapsedReturn" type="xsd:long"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="getTimeAsStringResponse">
<wsdl:part element="impl:getTimeAsStringResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getTimeAsElapsedResponse">
<wsdl:part element="impl:getTimeAsElapsedResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getTimeAsElapsedRequest">
<wsdl:part element="impl:getTimeAsElapsed" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getTimeAsStringRequest">
<wsdl:part element="impl:getTimeAsString" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="WSNewTestImpl">
<wsdl:operation name="getTimeAsString">
<wsdl:input message="impl:getTimeAsStringRequest" name="getTimeAsStringRequest">
</wsdl:input>
<wsdl:output message="impl:getTimeAsStringResponse" name="getTimeAsStringResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getTimeAsElapsed">
<wsdl:input message="impl:getTimeAsElapsedRequest" name="getTimeAsElapsedRequest">
</wsdl:input>
<wsdl:output message="impl:getTimeAsElapsedResponse" name="getTimeAsElapsedResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WSNewTestImplSoapBinding" type="impl:WSNewTestImpl">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getTimeAsString">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getTimeAsStringRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getTimeAsStringResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getTimeAsElapsed">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getTimeAsElapsedRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getTimeAsElapsedResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WSNewTestImplService">
<wsdl:port binding="impl:WSNewTestImplSoapBinding" name="WSNewTestImpl">
<wsdlsoap:address location="http://localhost:9090/WSTestOther/services/WSNewTestImpl"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I am not sure what other information to provide, if you need anything just ask. I am using Tomcat 7.0
Also I see the error in console:
[ERROR] The endpoint reference (EPR) for the Operation not found is /WSTestOther/services/WSNewTestImplService and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.
org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is /WSTestOther/services/WSNewTestImplService and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.
at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:102)
at org.apache.axis2.engine.Phase.invoke(Phase.java:329)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:168)
at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:273)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
[WARN] Deprecated usage of OMElement#declareNamespace(String,String) with empty prefix
I have created a WSDL to create a greeting service. Given below is the WSDL.
I am using thsi wsdl to create a generate and expose a web-service using the cxf:proxy-service in mule.
This is giving me errors.
Please review and help me undertand what is the problem with this WSDL.
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions name="HelloService"
targetNamespace="http://example.org/HelloService"
xmlns:tns="http://example.org/HelloService"
xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema targetNamespace="http://example.org/HelloService" >
<xsd:element name="LastName">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="lName" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="FirstName">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="fName" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Greeting">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="greet" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="shortRequest">
<wsdl:part type="tns:LastName" name="lastName"/>
</wsdl:message>
<wsdl:message name="fullRequest">
<wsdl:part type="tns:FirstName" name="firstName"/>
<wsdl:part type="tns:LastName" name="lastName"/>
</wsdl:message>
<wsdl:message name="greetingResponse">
<wsdl:part type="tns:greeting" name="greetings"/>
</wsdl:message>
<wsdl:portType name="HelloServicePortType">
<wsdl:operation name="simpleGreeting">
<wsdl:input message="tns:shortRequest" name="shortRequest" />
<wsdl:output message="tns:greetingResponse" name="greetingResponse" />
</wsdl:operation>
<wsdl:operation name="fullGreeting">
<wsdl:input message="tns:fullRequest" name="fullRequest" />
<wsdl:output message="tns:greetingResponse" name="greetingResponseFull" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloServiceSOAP" type="tns:HelloServicePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="simpleGreeting">
<soap:operation soapAction="" style="document" />
<wsdl:input name="shortRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="greetingResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="fullGreeting">
<soap:operation soapAction="" style="document" />
<wsdl:input name="fullRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="greetingResponseFull">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ProxyService">
<wsdl:port binding="tns:HelloServiceSOAP" name="HelloServiceSOAPB">
<soap:address location="http://localhost:8080/HelloService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Please help me if there is something wrong in my WSDL.
It is not working when I use it in mule cxf:proxy-service.
FGiven below si the Mule Flow which is using this WSDL to expose service.
<flow name="WS_In">
<http:inbound-endpoint address="http://localhost:8080/HelloService" exchange-pattern="request-response">
<cxf:proxy-service wsdlLocation="classpath:globalid3.wsdl" namespace="http://example.org/HelloService" service="ProxyService" />
</http:inbound-endpoint>
<component>
<prototype-object class="com.example.ServiceProxy">
</prototype-object>
</component>
<echo-component></echo-component>
<logger level="INFO" />
</flow>
and the Error is :
org.mule.api.lifecycle.LifecycleException: Lifecycle Manager 'WS_In.stage1' phase 'start' does not support phase 'dispose'
at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:156)
There is a casing issue in your WSDL. Instead of:
<wsdl:message name="greetingResponse">
<wsdl:part type="tns:greeting" name="greetings"/>
</wsdl:message>
you should have:
<wsdl:message name="greetingResponse">
<wsdl:part type="tns:Greeting" name="greetings"/>
</wsdl:message>
With this fixed, the following produces a web service that works fine when called from SOAPui:
<flow name="WS_In">
<http:inbound-endpoint address="http://localhost:8080/HelloService"
exchange-pattern="request-response">
<cxf:proxy-service wsdlLocation="classpath:globalid3.wsdl"
namespace="http://example.org/HelloService" service="ProxyService" />
</http:inbound-endpoint>
<custom-processor class="com.example.ServiceProxy" />
</flow>
Message processor:
package com.example;
import javax.xml.namespace.QName;
import org.apache.commons.lang.StringEscapeUtils;
import org.mule.api.MuleEvent;
import org.mule.api.MuleException;
import org.mule.api.processor.MessageProcessor;
public class ServiceProxy implements MessageProcessor
{
private final static QName SIMPLE_GREETING = new QName("http://example.org/HelloService",
"simpleGreeting");
public MuleEvent process(final MuleEvent event) throws MuleException
{
final QName operation = event.getFlowVariable("cxf_operation");
if (operation.equals(SIMPLE_GREETING))
{
final String lastName = event.getMuleContext()
.getExpressionLanguage()
.evaluate("xpath('/lastName').text", event);
final String responseXml = "<greetings><greet>Hi " + StringEscapeUtils.escapeXml(lastName)
+ "</greet></greetings>";
event.getMessage().setPayload(responseXml);
return event;
}
throw new UnsupportedOperationException(operation.getLocalPart() + " " + operation.getNamespaceURI()
+ " " + operation.getPrefix());
}
}
There is one way to do this using cxf:jaxws-service, but you'll need to generate the service class. Take a look here on how to do this.
After that you can configure the service in a very simple way.
<cxf:jaxws-service
serviceClass="mypackage.webservices.MyServicePortType"
validationEnabled="false">
</cxf:jaxws-service>
The flow that is working is as below.
<flow name="WS_In">
<http:inbound-endpoint address="http://localhost:8080/HelloService" exchange-pattern="request-response">
<cxf:proxy-service wsdlLocation="classpath:helloservice.wsdl" namespace="http://example.org/HelloService" service="ProxyService" />
</http:inbound-endpoint>
<component>
<prototype-object class="com.example.ServiceProxy">
</prototype-object>
</component>
<echo-component></echo-component>
<logger level="INFO" />
</flow>
And the WSDL is
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions name="HelloService"
targetNamespace="http://example.org/HelloService"
xmlns:tns="http://example.org/HelloService"
xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="shortRequest">
<wsdl:part type="xsd:string" name="lastName"/>
</wsdl:message>
<wsdl:message name="fullRequest">
<wsdl:part type="xsd:string" name="firstName"/>
<wsdl:part type="xsd:string" name="lastName"/>
</wsdl:message>
<wsdl:message name="greetingResponse">
<wsdl:part type="xsd:string" name="greetings"/>
</wsdl:message>
<wsdl:portType name="HelloServicePortType">
<wsdl:operation name="simpleGreeting">
<wsdl:input message="tns:shortRequest" name="shortRequest" />
<wsdl:output message="tns:greetingResponse" name="greetingResponse" />
</wsdl:operation>
<wsdl:operation name="fullGreeting">
<wsdl:input message="tns:fullRequest" name="fullRequest" />
<wsdl:output message="tns:greetingResponse" name="greetingResponseFull" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloServiceSOAP" type="tns:HelloServicePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="simpleGreeting">
<soap:operation soapAction="" style="document" />
<wsdl:input name="shortRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="greetingResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="fullGreeting">
<soap:operation soapAction="" style="document" />
<wsdl:input name="fullRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="greetingResponseFull">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ProxyService">
<wsdl:port binding="tns:HelloServiceSOAP" name="HelloServiceSOAPB">
<soap:address location="http://localhost:8080/HelloService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Thanks everyone for your help and support.
I am currently trying to use a web service I developed within an Integration Services package. When I try to configure the web service task I keep getting an error message. I configured the HTTP connection, and successfully downloaded the WSDL file which overrides my local copy. After that, on the input tab, I try to select the only service available "MyService" and then get the following error message:
Item has already been added. Key in dictionary: 'anyType' Key being added: 'anyType'
Anyone knows what this means?
Thanks in advance!
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="MyService" targetNamespace="http://www.MyDomain.de/webservices" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://www.MyDomain.de/webservices" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
<wsdl:types>
<xsd:schema targetNamespace="http://www.MyDomain.de/webservices/Imports">
<xsd:import schemaLocation="http://localhost/MyDomainMyService/MyDomain.Billing.Infrastructure.Wcf.MyService.svc?xsd=xsd0" namespace="http://www.MyDomain.de/webservices" />
<xsd:import schemaLocation="http://localhost/MyDomainMyService/MyDomain.Billing.Infrastructure.Wcf.MyService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="MyService_BookNewTransaction_InputMessage">
<wsdl:part name="parameters" element="tns:BookNewTransaction" />
</wsdl:message>
<wsdl:message name="MyService_BookNewTransaction_OutputMessage">
<wsdl:part name="parameters" element="tns:BookNewTransactionResponse" />
</wsdl:message>
<wsdl:portType name="MyService">
<wsdl:operation name="BookNewTransaction">
<wsdl:input wsaw:Action="http://www.MyDomain.de/webservices/MyService/BookNewTransaction" message="tns:MyService_BookNewTransaction_InputMessage" />
<wsdl:output wsaw:Action="http://www.MyDomain.de/webservices/MyService/BookNewTransactionResponse" message="tns:MyService_BookNewTransaction_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_MyService" type="tns:MyService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="BookNewTransaction">
<soap:operation soapAction="http://www.MyDomain.de/webservices/MyService/BookNewTransaction" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MyService">
<wsdl:port name="BasicHttpBinding_MyService" binding="tns:BasicHttpBinding_MyService">
<soap:address location="http://localhost/MyDomainMyService/MyDomain.Billing.Infrastructure.Wcf.MyService.svc" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Ok, I found a link describing my problem.
Check this:
http://sjbdeveloper.blogspot.com/2007/03/calling-wcf-web-service-from-ssis-web.html
This should solve the problem:
http://sjbdeveloper.blogspot.com/2007/03/fixing-wcf-ssis-web-service-task.html