[JBossWS] - javax.xml.ws.soap.SOAPFaultException: Port does not contain
by ramkrishnatripathi
Hi guys,
I am using jboss4.0.4GA.
I have created a webservice to add Two numbers.
After deploying the project I get CalculatorService.wsdl
Now I want to consume the webservice by client program.
After running the client program I get the following Exception:-
So Please tell me Where I am wrong??
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Endpoint {http://hello/jaws}CalculatorPort does not contain operation meta data for: {http://hello/}add
at com.sun.xml.ws.encoding.soap.ClientEncoderDecoder.toMessageInfo(ClientEncoderDecoder.java:80)
at com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toMessageInfo(SOAPXMLDecoder.java:200)
at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:549)
at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:288)
at com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:153)
at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:85)
at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:176)
at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:105)
at $Proxy7.add(Unknown Source)
at hello.JAXWSClient.main(JAXWSClient.java:36)
Interface
=======
package hello;
import java.rmi.Remote;
import java.rmi.RemoteException;
import javax.ejb.Local;
import javax.jws.WebMethod;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@Local
@WebService
@SOAPBinding(style=SOAPBinding.Style.RPC, use=SOAPBinding.Use.LITERAL)
public interface CalculatorInf extends Remote{
@WebMethod(operationName="add", action="urn:add")
public String add(int i, int j) throws RemoteException;
}
implementaion class
====
package hello;
import javax.jws.WebMethod;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.ejb.Stateless;
@WebService
//(endpointInterface="hello.CalculatorInf")
@Stateless
public class Calculator implements CalculatorInf {
public Calculator() {}
@WebMethod(operationName="add", action="urn:add")
public String add(int i, int j) {
int k = i +j ;
System.out.println(i + "+" + j +" = " + k);
return String.valueOf(k);
}
}
Client Program
=========
package hello;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.rpc.*;
public class JAXWSClient {
static String host = "localhost";
static String portType = "Calculator";
static String serviceName = "hello-servlet";
static String serviceEndpointAddress = "http://" + host + ":8080/" + serviceName;
static String nameSpace = "http://hello/jaws";
public static void main(String[] args) throws Exception {
URL wsdlLocation = new URL(serviceEndpointAddress + "/" + portType + "?WSDL");
QName serviceNameQ = new QName( nameSpace, "CalculatorPort");
Service service = Service.create(wsdlLocation, serviceNameQ);
CalculatorInf first = (CalculatorInf) service.getPort(serviceNameQ,hello.CalculatorInf.class);
System.out.println("1: " + first.add(2, 2));
}
}
WSDL
===
<definitions name="CalculatorService" targetNamespace="http://hello/jaws" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://hello/jaws" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <schema elementFormDefault="qualified" targetNamespace="http://hello/jaws" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://hello/jaws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
-
-
-
-
-
-
-
-
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
-
<soap:operation soapAction="" />
-
<soap:body use="literal" />
-
<soap:body use="literal" />
-
-
<soap:address location="http://RAM-KRISHNA:8080/hello-servlet/Calculator" />
=============
Thanks.........
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993338#3993338
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993338
19 years, 4 months
[JBoss Portal] - 401 error on selecting dashboard....
by macjboss
Hi,
I am trying to secure access to the portal using NTLM and Active Directory. So far I have manged to create my own servlet based on JCIFs NtlmServlet and created my own LoginModule to authenticate the user against AD and it all work fine; i can successfully log in to the portal.
I have changed the BASIC auth to FORM auth in the web.xml in jboss-portal.sar\portal-core.war\WEB-INF, configured the login page to point to my servlet, that deals with the post to j_security_check after forcing a log in through NTLM. My custom LoginModule then gets called with the username from j_security_check, they are checked against AD and their roles populated, one of which is AUTHENTICATED, user logs in.
The problem is; having been lgged in, when I click on My Dashboard. I get a 401 error:
This request requires HTTP authentication ()
It seems that going to this location, BASIC authentication is being applied. Having already successfully logged in to the portal, I'm not sure why this is happening?
If anyone could point me int he right direction that would be great.
Thanks,
Paul
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993333#3993333
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993333
19 years, 4 months