Hi,
I am using nightly build wsif-2.0.1_IB3 and trying to invoke web service
with complex types.
My client application is as below
///////////////********WSIFClient.java*************************/////////////
/////////////////
package com.singularity.spp.automatic.types;
import java.util.Iterator;
import javax.wsdl.Definition;
import javax.xml.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.wsif.WSIFException;
import org.apache.wsif.WSIFMessage;
import org.apache.wsif.WSIFOperation;
import org.apache.wsif.WSIFPort;
import org.apache.wsif.WSIFService;
import org.apache.wsif.WSIFServiceFactory;
import org.codehaus.xfire.XFire;
import org.codehaus.xfire.XFireFactory;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.binding.ObjectServiceFactory;
import com.ibm.wsdl.xml.WSDLReaderImpl;
import com.singularity.spp.services.PlatformManagerService;
import com.singularity.spp.to.CreateNewJobInTO;
import com.singularity.spp.to.CreateNewJobOutTO;
import com.singularity.spp.to.LogonInTO;
import com.singularity.spp.to.LogonOutTO;
public class WSIFClient {
public static void main(String[] args) throws Exception
{
WSIFClient wsifClient = new WSIFClient();
wsifClient.invoke();
}
public void invoke() throws Exception
{
// create a service factory
WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
WSDLReaderImpl wsdlRead = new WSDLReaderImpl();
WSIFService service =
factory.getService("C:\\wsdls\\PlatformManagerService.wsdl",
null,
null,
"http://singularity.co.uk/webservices/spp
<http://singularity.co.uk/webservices/spp> ",
"PlatformManagerServicePortType");
// map types
service.mapType(new QName("http://to.spp.singularity.com
<http://to.spp.singularity.com/> ", "CreateNewJobOutTO"),
Class.forName("com.singularity.spp.to.CreateNewJobOutTO"));
// get the port
WSIFPort port = service.getPort("PlatformManagerServiceHttpPort");
//Getting error at this line
// create the operation
WSIFOperation operation = port.createOperation("createNewJob");
// create the input, output and fault messages associated with this
operation
WSIFMessage input = operation.createInputMessage();
WSIFMessage output = operation.createOutputMessage();
WSIFMessage fault = operation.createFaultMessage();
CreateNewJobInTO inTO = new CreateNewJobInTO();
inTO.setProcessId("C1B758012E514EFA99F05A8A1E256AB9");
// populate the input message
input.setObjectPart("sessionId","A1B75EF12E514EFA11F0522A13256AB9");
input.setObjectPart("inTO",inTO);
// do the invocation
if (operation.executeRequestResponseOperation(input, output, fault))
{
// invocation succeeded, extract information from output
// message
CreateNewJobOutTO cnjOut = (CreateNewJobOutTO)
output.getObjectPart("outTO");
System.out.println("Job Id Created : " + cnjOut.getJobId());
} else {
System.out.println("Invocation failed");
// extract fault message info
}
}
}
///////////////********WSIFClient.java*************************/////////////
///////////////
Getting the below error at at getPort() call in the above code.
Exception in thread "main" org.apache.wsif.WSIFException: Port
'PlatformManagerServiceHttpPort' is not available and no alternative can be
found in {empty list}
at org.apache.wsif.base.WSIFServiceImpl.getPort(WSIFServiceImpl.java:577)
at com.singularity.spp.automatic.types.WSIFClient.main(WSIFClient.java:55)
Did anyone of you faced the similar problem?
Please suggest me a solution for this.
Thanks in advance,
regards,
Srinivas.
________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.
Singularity operates globally through its offices in New York, London,
Singapore, Ireland and India. Singularity Limited is incorporated in the United
Kingdom with Registration Number NI 31519 and its Registered Office at 100
Patrick Street, Derry, BT48 7EL, United Kingdom.
________________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]