cancel
Showing results for 
Search instead for 
Did you mean: 

Call Web Service from Activity

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ivan

if I want to call MII's Web Service from ME.Do you have a good Idea.

Thank you.

Former Member
0 Kudos

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

http://xmiiserver:50000/XMII/WSDLGen/SAPMEIntLite/SAPMEIntegration/services/Outbound/YieldBackflushi...

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Instead of calling ME web service from ME you can use ME API. In the same way as with NC.

You need the following module/service com.sap.me.productdefinition OperationConfigurationService. The corresponding method will be findOperationConfiguration