No adapter for endpoint

“Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?”

I spent more time* figuring out the cause of this exception than Sylvinho spent marauding down the left wing for Arsenal.

For a long time I thout it was due to the fact that I was trying to declare two methods in one endpoint class. I knew it wasnt the problem as I had seen it done.

I read elsewhere that the problem may have been a dependency clash / maven issue, again this was not the case.

 

The issue was that I was not consistent from my xsd right through to the service method. A simple example of what I was doing:

 

My xsd:

<xsd:element name=”CreateAccountRequest”>
<xsd:complexType>
<xsd:sequence>
<xsd:element name=”AccountDetails” type=”account:Account”/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name=”CreateAccountResponse“>
<xsd:complexType>
<xsd:sequence>
<xsd:element name=”accountID” type=”xsd:string“/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

my service endpoint was:

@PayloadRoot(localPart = “CreateAccountRequest”, namespace = TARGET_NAMESPACE)
public @ResponsePayload
String createAccount(
@RequestPayload CreateAccountRequest request) {

return (“31”);
}

 

my endpoint needed to be:

@PayloadRoot(localPart = “CreateAccountRequest”, namespace = TARGET_NAMESPACE)
public @ResponsePayload
CreateAccountResponse createAccount(
@RequestPayload CreateAccountRequest request) {

CreateAccountResponse response = new CreateAccountResponse();

response.setAccountID(“31”);
return response;
}

ie Рmy xsd was calling for a CreateAccountResponse object to be returned containing a String, I was simply trying to return a String.

 

 

 

Sylvinho.jpg

*he was at Arsenal for 2 years, I didnt spend quite two years figuring this out.

Advertisements

Git commands I frequently use but never remember…

  • Delete a remote git branch but keep it locally:

git push origin :branchname

  • Delete a local git branch but keep it remotely:

git branch -d branchname

  • Rename a local branch:

git branch -m

  • Rename current branch

git branch -m

  • Delete the previous remote commit and revert to the second to last one

git reset –hard