on 12-27-2010 7:16 AM
Hi All,
I want to call Me's We Service from ME's Activity.
Please tell me which ME's API can be use to call Web Service.
Regards.
Qiang
Hi Ivan
if I want to call MII's Web Service from ME.Do you have a good Idea.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To call XMII web service you need to generate WSLD for the transaction you want to call.
Use this URL to generate WSDL:
http://\[host\]:\[port\]/XMII/WSDLGen/\[transaction name\]
where \[transaction name\] is the full path to the transaction in xMII Workbench
For example SAPMEIntLite transaction YieldBackflushingCorrelationService will have the following WSDL URL
After you got WSDL file put it into Eclipse project Web Service Client ( Web Service Client (Outbound) in SDK 2.0.2 ) into the wsdl folder. To generate java proxy classes execute ant target build.webservice.client ( build.webservice.client.out in SDK 2.0.2 ).
Use the proxy classes in your implementation to call web service
update. I try to run the following source code ,but Exception was happened.
String endpointUrl="ipaddress:50001/manufacturing-services/OperationServiceService";
QName serviceName = new QName("http://sap.com/xi/ME", "OperationService");
QName portName = new QName("http://sap.com/xi/ME", "OperationProcessingIn");
Service service = Service.create(serviceName);
service.addPort(portName, "http://schemas.xmlsoap.org/wsdl/soap/http", endpointUrl);
//Dispatch dispatch = service.createDispatch(portName, javax/xml/soap/SOAPMessage, javax.xml.ws.Service.Mode.MESSAGE);
//Dispatch dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
MessageFactory mf = MessageFactory.newInstance("SOAP 1.1 Protocol");
SOAPMessage request = mf.createMessage();
SOAPPart part = request.getSOAPPart();
SOAPEnvelope env = part.getEnvelope();
SOAPBody body = env.getBody();
//TODO
SOAPElement element = body.addChildElement("OperationByBasicDataQuery_sync", "ns1", "http://sap.com/xi/ME");
SOAPElement basicData = element.addChildElement("OperationByBasicDataQuery", "ns1", "http://sap.com/xi/ME");
SOAPElement site = basicData.addChildElement("SiteRef", "ns1", "http://sap.com/xi/ME");
site.addTextNode("CHN");
SOAPElement operation = basicData.addChildElement("Operation", "ns1", "http://sap.com/xi/ME");
operation.addTextNode("COIL");
SOAPElement revision = basicData.addChildElement("Revision", "ns1", "http://sap.com/xi/ME");
revision.addTextNode("A");
request.saveChanges();
// Exception happened
SOAPMessage resMsg = dispatch.invoke(request);
Exception:
Caused by: com.sap.engine.services.webservices.espbase.client.bindings.exceptions.TransportBindingException: Client protocol has thrown an exception. Protocol name is [Unknown]. See nested exception for details.
at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.sendMessage(SOAPTransportBinding.java:1315)
at com.sap.engine.services.webservices.espbase.client.jaxws.core.SOAPDispatchImpl.invokeBinding(SOAPDispatchImpl.java:193)
... 49 more
Caused by: com.sap.engine.services.webservices.espbase.client.bindings.exceptions.TransportBindingException: Invalid Response code (401). Server <https://qliu37.asiapacific.hpqcorp.net:50001/manufacturing-services/OperationServiceService> returned message <Unauthorized>.
at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.handleSOAPResponseMessage(SOAPTransportBinding.java:579)
at com.sap.engine.services.webservices.espbase.client.bindings.impl.SOAPTransportBinding.sendMessage(SOAPTransportBinding.java:1258)
... 50 more
Edited by: qiang liu on Dec 27, 2010 1:38 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.