bsnyder wrote:
>
> On 5/17/07, Benamin <[EMAIL PROTECTED]> wrote:
>
>>> xbean.xml:
>>>
>>> beans xmlns:http="http://servicemix.apache.org/http/1.0"
>>> xmlns:sm="http://servicemix.apache.org/servicemanagerassembly">
>>>
>>> <http:endpoint service="sm:httpService"
>>> endpoint="soap"
>>> role="provider"
>>> locationURI="http://localhost:8192/NSRService/"
>>> defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>> soap="true"
>>>
>>> wsdlResource="http://localhost:8192/NSRService/main.wsdl"
>>> soapAction="getNSR" />
>>>
>>> </beans>
>
>> The only question I have is about the soapAction attribute. I don't
>> believe it has much affect unless you're using a SOAP stack that
>> utilizes it but it doesn't hurt anything to set it.
>
>
Well, the soapAction is the method that needs to be called on the web
service that receives the data produced in the SE. So I need that, right?
For some reason, I still get the null pointer exception when trying to do
the sendSync. Is there anything else I can try.? I am reposting the
relevant code from the MyEndpoint class.
public void poll() throws Exception
{
invokeIdentityService();
}
private boolean invokeIdentityService() throws MessagingException {
ComponentContext ctx =
getServiceUnit().getComponent().getComponentContext();
QName identityService = new
QName("http://servicemix.apache.org/servicemanagerassembly",
"httpService");
InOut identityExchange = exchangeFactory.createInOutExchange();
configureTarget("Identity Service", identityExchange, ctx,
null, identityService, "soap", "");
NormalizedMessage in = identityExchange.createMessage();
in.setContent(new StringSource("Testing"));
identityExchange.setInMessage(in);
sendSync(identityExchange);
NormalizedMessage out = identityExchange.getOutMessage();
boolean login = false;
if (out != null) {
//login = support.parseIdentityOutMessage(out.getContent());
} else {
// TODO: how should we handle faults
}
done(identityExchange);
return login;
}
public void configureTarget(String serviceDesc, MessageExchange
exchange, ComponentContext context, QName _interface, QName service,
String endpoint, String uri) throws MessagingException {
if (_interface == null && service == null && uri == null) {
throw new MessagingException(serviceDesc + ": interface,
service or uri should be specified");
}
/*if (uri != null) {
URIResolver.configureExchange(exchange, context, uri);
}*/
if (_interface != null) {
exchange.setInterfaceName(_interface);
}
if (service != null) {
exchange.setService(service);
if (endpoint != null) {
ServiceEndpoint se = context.getEndpoint(service,
endpoint);
exchange.setEndpoint(se);
}
}
}
The Error:
ERROR - MyComponent - Caught exception while polling:
java.lang.NullPointerException
java.lang.NullPointerException
at
org.apache.servicemix.common.endpoints.SimpleEndpoint.sendSync(SimpleEndpoint.java:71)
at
org.apache.servicemix.samples.serviceManagerAssembly.MyEndpoint.invokeIdentityService(MyEndpoint.java:289)
at
org.apache.servicemix.samples.serviceManagerAssembly.MyEndpoint.poll(MyEndpoint.java:274)
at
org.apache.servicemix.common.endpoints.PollingEndpoint$PollSchedulerTask$1.run(PollingEndpoint.java:155)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)
--
View this message in context:
http://www.nabble.com/SE-that-continually-reads-and-sends-data-tf3764809s12049.html#a10673594
Sent from the ServiceMix - User mailing list archive at Nabble.com.