Custom Timer Job to execute WCF web service error - Could not find default endpoint element that references contract

Hi,
I am currently creating custom timer job to call WCF web service to perform nighty job to update employee document library metadata. If I update regular list/library items it updates correctly on a specified interval basis. However when I try to integrate
the WCF client, it throws error shown below :
Could not find default endpoint element that references contract EmployeeServiceReference.
EmployeeServiceClient in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
I followed exact instructions Andrew Connell has provided but included my logic in execute()
public
override
void Execute(Guid
targetInstanceId)
var empClient =
new
'ServiceReference.EmployeeServiceClient();
var employee = empClient.EmployeesMethod();
I have tried all approaches to manually adding app.config settings in sharepoing web.config but still it throws the error mentioned. It seems that application config and sharepoint site config binding issue still exist and cannot be resolved.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding
name="BasicHttpBinding_EmployeeService"
/>
</basicHttpBinding>
<netTcpBinding>
<binding
name="CustomBinding_EmployeeService">
<security>
<transport
protectionLevel="None"
/>
</security>
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding
name="WSHttpBinding_EmployeeService">
<security
mode="None"
/>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint
address="http://services.mycomp.com/EmployeeService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_EmployeeService"
contract="EmployeeServiceReference.EmployeeService"
name="WSHttpBinding_EmployeeService"
/>
<endpoint
address="http://services.mycomp.com/EmployeeService.svc/soap"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_EmployeeService"
contract="EmployeeServiceReference.EmployeeService"
name="BasicHttpBinding_EmployeeService"
/>
<endpoint
address="net.tcp://crmapp.mycomp.com:5050/EmployeeService.svc/tcp"
binding="netTcpBinding"
bindingConfiguration="CustomBinding_EmployeeService"
contract="EmployeeServiceReference.EmployeeService"
name="CustomBinding_EmployeeService">
<identity>
<userPrincipalName
value="[email protected]"
/>
</identity>
</endpoint>
</client>
</system.serviceModel>
Will you please help resolving this issue?

Hi,
You can use any of the three approaches:-
1) Access web application's web.config programmatically in Execute() method.
http://praveenkasireddy.wordpress.com/2012/12/14/access-web-application-configuration-values-in-timer-job-sharepoint/
2) Store the configuration in xml and upload it to SharePoint document library then read from there
http://www.sharepointdynamics.net/2011/08/using-an-xml-settings-file-to-store-values-for-your-sharepoint-projects/
3) Programmatically configure a WCF endpoint.
http://msdn.microsoft.com/en-us/library/ff647110.aspx
Regards, Shruti

Similar Messages

  • Web service fault:  could not find a target service

    I'm attempting to invoke a method on a web service. I
    instantiate the web service and call the method as indicated in the
    first three lines of the attached code (where sf_cred is a simple
    structure).
    The first two lines are fine, but the call to the "login"
    method produces the following error:
    Could not perform web service invocation "login".
    Here is the fault returned when invoking the web service
    operation:
    AxisFault
    faultCode: {
    http://xml.apache.org/axis/}Server.NoService}
    faultSubcode:
    faultString: The AXIS engine could not find a target service
    to invoke! targetService is
    faultActor:
    faultNode:
    faultDetail:
    http://xml.apache.org/axis/}stackTrace:The
    AXIS engine could not find a target service to invoke!
    targetService is
    at
    org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
    at
    org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
    at
    org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:10 87)
    at
    org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch( Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
    at org.apache.xerces.parsers.XML11Configuration.parse...
    Can anyone point me to the cause of this error, either with
    something missing in my code or with a problem in the WSDL
    (provided in attached code)?

    ERROR [EngineConfigurationFactoryServlet] Unable to
    find config file
    Creating new servlet engine config file:
    /WEB-INF/server-config.wsdd
    I want to know what is server-config.wsdd
    what it contains?You can take this generated file and include it in your project. For a complete description of the various elements see:
    http://ws.apache.org/axis/java/reference.html#DeploymentWSDDReference
    My Eclipse IDE don't have required set AXISCLASSPATH.
    because already
    include the folowing jar automatically
    )saaj.jar
    ii)jaxrpc.jar
    iii)commons-discovery.jar
    iv)commons-logging.jar
    v)log4j-1.2.8.jarWhat does happyaxis.jsp say? From the docs:
    Java 1.4 changed the rules as to how packages beginning in java.* and javax.* get loaded. Specifically, they only get loaded from endorsed directories. jaxrpc.jar and saaj.jar contain javax packages, so they may not get picked up. If happyaxis.jsp (see below) cannot find the relevant packages, copy them from axis/WEB-INF/lib to CATALINA_HOME/common/lib and restart Tomcat.
    Message was edited by:
    YoGee

  • WCF Published Orch - Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding

    I have an orchestration published as a web service.  It was working fine on our test environment, we deployed to production, and now getting this error.  The website wouldn't go in the BizTalk MSI, so we copied the files.  We reset the Authentication
    to match the test system (we are using Basic Auth).
    When we try to browse the webservice in the browser, it prompt for userid/password, we enter it, then it gives the following error. 
    I'm not even sure what it means by "base address", if URL was https://prod.mydomain.com/myapp/myservice.svc, would https://prod.mydomain.com be the based address? In the test environment, the URL is https://test.mydomain.com/myapp/myservice.svc. 
    In both environments, we have a customer calling this webservice.
    Also, I don't know what it means "scheme http".  We are using https:... on the URL.
    I'm thinking this is either security related, something to do with the app pool being different, or maybe something to do with bindings. 
    Thanks,
    Neal Walter
    http://MyLifeIsMyMessage.net
    Web.config:
        <services>
          <!-- Note: the service name must match the configuration name for the service implementation. -->
          <service name="Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance" behaviorConfiguration="ServiceBehaviorConfiguration">
            <endpoint name="HttpMexEndpoint" address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" />
            <!--<endpoint name="HttpsMexEndpoint" address="mex" binding="mexHttpsBinding" bindingConfiguration="" contract="IMetadataExchange" />-->
          </service>
        </services>
      </system.serviceModel>
        <system.webServer>
            <security>
                <authorization>
                    <remove users="*" roles="" verbs="" />
                    <add accessType="Allow" users="myCustomer" />
                </authorization>
            </security>
        </system.webServer>
    Server Error in '/eSecuritelIn' Application.
    Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered
    base address schemes are [https].
    Description:
    An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the
    code. Exception Details: System.InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes are [https].
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using
    the exception stack trace below.
    Stack Trace:
    [InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes
    are [https].]
       System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +16582113
       System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1
    addBaseAddress) +1082
       System.ServiceModel.ServiceHostBase.ApplyConfiguration() +156
       System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +215
       System.ServiceModel.ServiceHost..ctor(Object singletonInstance, Uri[] baseAddresses) +400
       Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHost`3..ctor(IsolatedReceiverType isolatedReceiver, BizTalkServiceInstance serviceInstance, Uri[] baseAddresses)
    +36
       Microsoft.BizTalk.Adapter.Wcf.Runtime.WebServiceHostFactory`3.CreateServiceHost(String constructorString, Uri[] baseAddresses) +533
       System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1413
       System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1172
    [ServiceActivationException: The service '/eSecuritelIn/eSecuritelIn_OrchPublished_RepairEquipmentService.svc' cannot be activated due to an exception during compilation. 
    The exception message is: Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes are [https]..]
       System.Runtime.AsyncResult.End(IAsyncResult result) +901424
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178702
       System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET
    Version:4.0.30319.272

    When you want to migrate Web Applications from one environment to other there are multiple ways to achieve it.
    1) Migrate in MSI- Export MSI and select the option for your Web Application, however I don't recommend this option
    2) Is to browse the folder for Web Application(Right click on web app and browse). Copy this folder(normally within inetpub folder) and take it to the inetpub folder of other environment. Later from the IISManager create application.
    Are you not using the same Binding file?
    Check you web.config file and see if the endpoint is configured for mexHTTpBinding.
    Old: binding="mexHttpBinding"
    New: binding="mexHttpsBinding"
    web.config snippet:
    <services>
    <service behaviorConfiguration="ServiceBehavior" name="LIMS.UI.Web.WCFServices.Accessioning.QuickDataEntryService">
    <endpoint behaviorConfiguration="AspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="webBinding"
    contract="LIMS.UI.Web.WCFServices.Accessioning.QuickDataEntryService" />
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
    </service>
    Also look into the below article- How to fix: "Could not find a base
    address that matches scheme http for the endpoint with binding WebHttpBinding" Errors
    Moving to https = Could not find a base address that matches scheme
    Thanks,
    Prashant
    Please mark this post accordingly if it answers your query or is helpful.

  • Errors:"Could not find Web Ser"- "Failed to Lunch E1 menu on HTML Engine"

    Hi all
    I am trying to install JD Edwards EnterpriseOne and I am using two different machines.
    First machine:
    Installed Enterprise and Database Server
    Second Machine:
    Installed Deployment Server.
    Installed Oracle Application Server.
    Installed Server Manager.
    Distributed the HTML Server.
    Registered the Oracle Application Server and HTML Server and both services are up and running.
    When I try to navigate in the Tools->EnterpriseOne Menu I have two errors:
    First error: "Could not find Web Server"
    -> followed by the second error: "Failed to launch E1 Menu on HTML Engine"
    Is there any configuration steps that I am missing?
    Please suggest anything to solve this issue.
    Thank you and best regards

    Hi,
    you can't start EnterpriseOne Menu from "tools".
    Just point you browser to the Distributed the HTML Server url.
    Regards.
    Bruno Condemi

  • SharePoint 2010 with SQL Reporting Services 2012 "Installation Error: Could not find SOFTWARE\Microsoft\Microsoft SQL Server\110 registry key"

    i have a small sharepoint farm "2 servers" (WFE) and SQL Server 2012 ,
    i installed rsSharePoint for reporting services , as a read the Reporting services is Application Service  with SQL 2012 not as SQL 2008 R2 with SharePoint integrated mode, so after installation when am trying to configure the  SQL Server
    Reporting Services Application services i got the below error :
    "Installation Error: Could not find SOFTWARE\Microsoft\Microsoft SQL Server\110 registry key"
    any kind of help would be much appreciated .

    I'm having the same issue, but to me it seems like the instructions I've seen are all over the place.  I already have SP 2013 and SQL 2012 SP 1 installed.  I already added the features for Reporting Services - Sharepoint and Reporting Services
    Add-in for SharePoint Products.  I didn't see the Reporting Service service in CA, so I ran the powershell scripts to add SPRSService and SPRSServiceProxy. 
    My initial quest, was to get the BI features enabled, which took me on the journey of adding the Report Services, then I got the error.
    Then when I read this about installing the BI features
    http://blogs.msdn.com/b/querysimon/archive/2012/11/26/installing-the-bi-features-of-sharepoint-2013.aspx, which I already had SQL and SP installed.  Do I have to rerun and selct the SQL Server PowerPoint for SharePoint option?  I have the PowerPoint
    Configuration Tool on my SQL server, I run it and I get PowerPivot for SP 2013 Configuranoi is missing prerequisits:  SP 2013 EE is required.  Which I have EE.
    Is Reporting Services different or in addition to the BI Feature (PowerPivot)? 
    Have I missed a step?
    Thanks for you help.
    Kim
    Kim.Williams

  • Reportings Services in a 2-Tier Architecture / (Installation Error: Could not find SOFTWARE\Microsoft\Microsoft SQL Server\110 registry key. )

    Hello,
    we want to install Reporting Services in a 2-Tier Architecture. The Servers are the following:
    SERVER1: Windows Server 2012 and SQL Server 2012
    SERVER2: SharePoint 2013 (WFE)
    Reporting Server is installed on SERVER1 and running. On SERVER2 the registration of the service through Powershell was done but it does not start. An Error when starting the Service on the server occurs with the message:
    "Installation Error: Could not find SOFTWARE\Microsoft\Microsoft SQL Server\110 registry key."
    I have found the following in msdn stating that a minimal of the same SharePoint Installation must exist on the Reporting Server. The article is for SQL Server 2008 R2 and SharePoint 2010. Is this the case also for SQL Server 2012 and SharePoint 2013 and
    the root of the problem? http://msdn.microsoft.com/en-us/library/bb510781%28v=sql.105%29.aspx
    If so does this mean that I require for the installation another License?!?!
    Thank you in advance!

    Hi,
    According to your post, my understanding is that you wanted to install Reporting Services in a 2-Tier Architecture.
    As the article
    say, if you use Two-Computer Deployment, the first computer hosts an instance of a SharePoint product. The Reporting Services Add-in is installed on this computer. The second computer hosts SQL Server Reporting Services and the Database Engine.
    The steps to install in a  two-tier environment are very similar to a standalone environment hence you can go to refer to the ' Install Reporting Services SharePoint Mode for SharePoint 2013' article at http://msdn.microsoft.com/en-us/library/jj219068(v=sql.110).aspx
    To install in a  two-tier environment, you can refer to:
    How to setup, configure and test
    SQL 2012 SP1 SSRS with SharePoint 2013 SP1
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Unable to execute Test-Mailflow cmdlet. Could not find any available Domain Controller

    I started receiving this error in SCOM while testing Exchange 2007 Mail flow. Normally the tests work just fine, and when I execute"test-mailflow" on the offending server, it works just fine. The alert doesn't have enough details to find out what
    is wrong. Can anyone help out?
    Alert Description:
    Unable to execute Test-Mailflow cmdlet. Could not find any available Domain Controller
    Environment: SCOM 2012 R2 UR4
    MP: Exchange 2007 MP, latest update
    Monitor: Exchange 2007 Test Local Mail Flow Monitor
    Brody Kilpatrick

    Hi,
    After you execute"test-mailflow" on the offending server, please also look into event logs to check is there any errors or warnings. SCOM is a tool to collect information, from my point of view, this message is collected from Exchange server, so
    you may need to check event viewer.
    In addition, please also make sure your Exchange environment is under monitored. And have you followed the Exchange 2007 MP guide to configure the MP?
    Make sure the Client Access Server is under monitored, you may check the Application Event log on the Client Access Server, and make sure there are no errors or warnings indicating a problem with the Client Access Server.
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • The Web application at could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application

    Hi,
    I have created on windows service to fetch sharepoint list ad update the list items.
    when i run this service in sharepoint server(where the sharepoint site is hosted),it is working fine. If i run the same service in another machine(sharepoint installed in this machine also). it is giving the below error
    The Web application at [URL] could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
    Code snippet
    SPSite sharepointSite = null;
                SPWeb rootWeb = null;
                try
                    //SPList current = null, previous = null;
                    string colmId = ConfigurationManager.AppSettings[ID_COLM];
                    List<TaskEntity> list = new List<TaskEntity>();
                    sharepointSite = new SPSite(URL);
                    rootWeb = sharepointSite.OpenWeb();
                    SPList current = rootWeb.Lists[ConfigurationManager.AppSettings[OMEGA_REGISTRATION_LIST]];
                    WriteEventLog("current" + current.Items.Count.ToString());
                catch (Exception ex)
                    ExceptionMethod(ex);
                finally
                    sharepointSite = null;
                    rootWeb = null;
    I have pointed .net framework to 3.5 version and target palform as Any CPU. Please suggest me

    Hi mallela1,
    I also had similar issue couple of months back when I was trying to access a remote URL from a Windows service when the site does not exists in the server where service resides.
    You cannot access a remote url (even though it is SharePoint server and also in same network ) from server object model.
    SPSite can look in the current server only. here what is happening is SPSite will look for this in the current server DB and it is not finding this errror.
    So please dont use ServerObject model for accessing remote sites. You can use Client Object model for the code /requirement you have stated above.
    I wasted lot of time in finding a work around to make to work. It did not. So look for other options.
    Regards,
    Nandini

  • Urgent web service problem. can not find url of WSDL

    Hi all,
    I met a web service problem recently.
    1 I have set up a web service and reside it on Java System Application server9.0. But there's a bug of this web server, which will stop after the user log off the server. I have installed the Application server as a windows service. It suppose to run all the time. I don't know why the server stop after I log off.
    2 For that reason, I tried to migrant my web service from the java application server to Tomcat5.5. I deployed my web service to folder webApps. But I don't know the WSDL url of the web service, which is the web reference for my frent-end c#.net application.
    Anybody can give me some idea?
    Many thanks

    Nobody knows?
    Please help me

  • 2 Java ME Web Service Errors of "Not Compliant with JSR-172"

    This happened when I use Microsoft's ASMX-based WSDL file on a Java ME WS client.
    Say I had a test.asmx WSDL. Then I use NetBeans, and I go to New > Java ME Web Service Client
    I tried to import from running web service, URL "http://www.testhost.com/wspackage/test.asmx?WSDL"
    and then the popup validation error told me "Reference in element is not supported by this version of stub compiler"
    also the X logo error told me "testasmx.wsdl is not compliant with Java ME Web Services specification (JSR-172)"
    I wondered what's going on? Is there any data types not supported by JSR-172? Which is it?
    When I "Validate XML" this ASMX file, it pops this:
    "Error: src-resolve: Cannot resolve the name 's:schema' to a(n) 'element declaration' component."
    The "types" section of my WSDL are like this:
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/MMWebServices/Coverage"
    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    targetNamespace="http://tempuri.org/MMWebServices/Coverage" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/MMWebServices/Coverage">
    <s:import namespace="http://www.w3.org/2001/XMLSchema" />
    <s:element name="ViewListDoctor">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="iUserId" type="s:int" />
    <s:element minOccurs="1" maxOccurs="1" name="iASchId" type="s:int" />
    <s:element minOccurs="0" maxOccurs="1" name="sSearchKeyword" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="dsView">
    <s:complexType>
    <s:sequence>
    <s:element ref="s:schema" /> // <<error occured on this line, and every time the ref="s:schema" shows up <<
    Anyone have experienced this?

    Yes, thx u. I didn't realized I was posting on the wrong section (Enterprise) so I posted again to the J2ME/MIDP section since it was all about mobility. Please delete the first post.

  • Web service operation could not be found.

    Would CF give this error if there was simply an error in the
    cffunction code? The service is there and it looks fine. In fact,
    most of the code comes from another cffunction in the same file,
    but with more arguments and some additional code. I have cleared
    the server cache several times.
    It's driving me nuts. The error codes sometimes just don't
    make any sense or are misleading. I hope future versions of CF deal
    with this better.
    Web service operation "RegisterFiles" with parameters
    {groupID={185},folder={/},filename={MOV04684.MPG},userName={xxxx},userPassword={xxxx},fil eType={video}}
    could not be found.

    NealCrankshaw, in your case you definitaly need to use java
    in order to create and use complex data types arguments with your
    web service. Here are the steps to follow in nutshell
    1. Use wsdl2java tool (CF_HOME/runtime/bin) tsupplying URL to
    webservice WSDL to create java code.
    2. Create java classes by compiling java code created in step
    1
    3. Create jar file(s) from classes in step 2
    4. Put jar file in CF classpath or just copy it to
    CF_HOME/lib directory
    5. Using <cfscript> create required objects, arrays and
    other arguments and supply them to web service method call.

  • Web service handler could not called in client web service

    Hi All,
    I have two web service ServiceA & ServiceB and both implemented in weblogic.
    The ServiceA is SSL enable and protocol is https which is not published by me.
    The ServieB is my web service(wls8.1) and act as client for ServiceA.
    My problem is when i hit my service, its not able set the handler when it call ServiceA but it is invoking the service and giving application exception like authentication error.
    My service file:
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.HandlerRegistry;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import weblogic.webservice.client.SSLAdapterFactory;
    import weblogic.webservice.client.WLSSLAdapter;
    public class HelloService {
    String wsdl = "https://188.122.123.23/RemoetService?WSDL";
    static {
    SSLAdapterFactory factory = SSLAdapterFactory.getDefaultFactory();
    WLSSLAdapter adapter = (WLSSLAdapter) factory.getSSLAdapter();
    adapter.setTrustedCertificatesFile("D:\\lib\\certs
    cacerts");
    factory.setDefaultAdapter(adapter);
    System.setProperty("weblogic.xml.encryption.verbose","true");
    System.setProperty("weblogic.xml.signature.verbose","true");
    System.setProperty("weblogic.webservice.verbose","true");
    public String sayHello(String user) {
    RemoteService_Impl service = new RemoteService_Impl(wsdl);
    RemotePortType port = service.getRemoteServicePort1();
    String namespace = service.getServiceName()
    .getNamespaceURI();
    QName portName = new QName(namespace,
    "RemoteServicePortType");
    HandlerRegistry reg = service.getHandlerRegistry();
    List handlerList = new ArrayList();
    Map map = new HashMap();
    map.put("Username", "user1");
    map.put("Password", "pwd1");
    HandlerInfo info = new HandlerInfo();
    info.setHandlerClass(WSClientHandler .class);
    info.setHandlerConfig(map);
    handlerList.add(info);
    reg.setHandlerChain(portName,(List)handlerList);
    RemoteServiceResponse = port.callMe(name);
    My Handler file:
    package com.test;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.Handler;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.MessageContext;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import javax.xml.soap.Name;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.soap.SOAPHeaderElement;
    public class WSClientHandler implements Handler {
    private HandlerInfo handlerInfo;
    public WSClientAuthenticateHandler(){}
    public void init(HandlerInfo hi) {
    System.out.println("Handler init");
    handlerInfo = hi;
    public void destroy() {
    System.out.println("Handler destroy method called");
    handlerInfo = null;
    public QName[] getHeaders() {
    System.out.println("Handler Header method called");
    try {
    Map map = handlerInfo.getHandlerConfig();
    QName[] headers = handlerInfo.getHeaders();
    System.out.println(" Config :"+map);
    for(int i=0;i<headers.length;i++) {
    System.out.println(headers.getLocalPart()+" "+
    headers.toString()+" "+headers.getNamespaceURI());
    }catch(Exception e) {
    e.printStackTrace();
    return handlerInfo.getHeaders();
    public boolean handleRequest(MessageContext mc) {
    SOAPMessageContext smc = (SOAPMessageContext) mc;
    System.out.println("Calling handler class.....................");
    try {
    SOAPEnvelope se = smc.getMessage().getSOAPPart().getEnvelope();
    System.out.println("Calling handler class.....................");
    SOAPHeader soapHeader = se.getHeader();
    Name headerName = se.createName("Security","wsse","http://schemas.xmlsoap.org/ws/2002/07/secext");
    SOAPHeaderElement headerElement = soapHeader.addHeaderElement(headerName);
    SOAPElement element = headerElement.addChildElement(se.createName("UsernameToken", "wsse", "http://schemas.xmlsoap.org/ws/2002/07/secext"));
    element.addChildElement(se.createName("Username", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testuser");
    element.addChildElement(se.createName("Password", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testpwd");
    System.out.println("Calling handler class.....................");
    System.out.println("** Request: \n "se.toString()"\n");
    }catch(SOAPException e) {
    e.printStackTrace();
    return true;
    /** * Specifies that the SOAP response message be logged to a
    * log file before the
    * * message is sent back to the client application
    * that invoked the Web service.
    public boolean handleResponse(MessageContext mc) {
    System.out.println("Handler Response method called");
    SOAPMessageContext messageContext = (SOAPMessageContext) mc;
    System.out.println("** Response: \n"messageContext.getMessage().toString()"\n");
    return true;
    /** * Specifies that a message be logged to the log file if a SOAP fault is
    * * thrown by the Handler instance.
    public boolean handleFault(MessageContext mc) {
    SOAPMessageContext messageContext = (SOAPMessageContext) mc;
    System.out.println("** Fault: \n"messageContext.getMessage().toString()"\n");
    return true;
    Please need help here.
    Thanks in Advance,
    pps

    I have tested static client calling using handler simple above service and found the issues.
    QName portName = new QName(namespace,
    "*RemoteServicePortType*");
    The above line code has created the issues,becuase in wsdl file ( given similar wsdl file).
    <?xml version="1.0"; encoding="UTF-8"?>
    <definitions name="HelloService"
    targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <message name="SayHelloRequest">
    <part name="firstName" type="xsd:string"/>
    </message>
    <message name="SayHelloResponse">
    <part name="greeting" type="xsd:string"/>
    </message>
    *<portType name="RemoteServicePortType">*
    <operation name="sayHello">
    <input message="tns:SayHelloRequest"/>
    <output message="tns:SayHelloResponse"/>
    </operation>
    </portType>
    <binding name="Hello_Binding" type="tns:*RemoteServicePortType*">
    <soap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="sayHello">
    <soap:operation soapAction="sayHello"/>
    <input>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </input>
    <output>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </output>
    </operation>
    </binding>
    <service name="Hello_Service">
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType1*">
    <soap:address
    location="http://host1:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType2*">
    <soap:address
    location="http://host2:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType3*">
    <soap:address
    location="http://host3:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType4*">
    <soap:address
    location="http://host4:8080/soap/servlet/rpcrouter"/>
    </port>
    </service>
    </definitions>
    From the above WSDL, I have four port name (port binding="tns:Hello_Binding" name="*RemoteServicePortType1*) which is not matching with PortType (portType name="*RemoteServicePortType*")
    even i have iterated from getPorts() method and used to invoke the service.But handler was not calling when i invoke.
    Please guide me here how i specify correct portname which can call Handler class also.
    Thanks in advance,
    pps

  • Web service handler could not registered/called in client web service

    Hi Expert,
    I have two web service ServiceA & ServiceB and both implemented in weblogic.
    The ServiceA is SSL enable and protocol is https which is not published by me.
    The ServieB is my web service(wls8.1) and act as client for ServiceA.
    My problem is when i hit my service, its not able set the handler when it call ServiceA but it is invoking the service and giving application exception like authentication error.
    My service file:
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.HandlerRegistry;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import weblogic.webservice.client.SSLAdapterFactory;
    import weblogic.webservice.client.WLSSLAdapter;
    public class HelloService {
    String wsdl = "https://188.122.123.23/RemoetService?WSDL";
    static     {
              SSLAdapterFactory factory =                SSLAdapterFactory.getDefaultFactory();
              WLSSLAdapter adapter = (WLSSLAdapter)     factory.getSSLAdapter();
              adapter.setTrustedCertificatesFile("D:\\lib\\certs\\cacerts");
              factory.setDefaultAdapter(adapter);
              System.setProperty("weblogic.xml.encryption.verbose","true");
              System.setProperty("weblogic.xml.signature.verbose","true");
              System.setProperty("weblogic.webservice.verbose","true");
         public String sayHello(String user) {
              RemoteService_Impl service = new RemoteService_Impl(wsdl);
              RemotePortType port = service.getRemoteServicePort1();
              String namespace = service.getServiceName()
                        .getNamespaceURI();
              QName portName = new QName(namespace,
                        "RemoteServicePortType");
              HandlerRegistry reg = service.getHandlerRegistry();
              List handlerList = new ArrayList();
              Map map = new HashMap();
              map.put("Username", "user1");
              map.put("Password", "pwd1");
              HandlerInfo info = new HandlerInfo();
              info.setHandlerClass(WSClientHandler .class);
              info.setHandlerConfig(map);
              handlerList.add(info);
              reg.setHandlerChain(portName,(List)handlerList);
              RemoteServiceResponse = port.callMe(name);
    My Handler Class:
    package com.test;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.Handler;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.MessageContext;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import javax.xml.soap.Name;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.soap.SOAPHeaderElement;
    public class WSClientHandler implements Handler {
         private HandlerInfo handlerInfo;
         public WSClientAuthenticateHandler(){}
         public void init(HandlerInfo hi) {   
              System.out.println("Handler init");
              handlerInfo = hi;
         public void destroy() {
              System.out.println("Handler destroy method called");
              handlerInfo = null;
         public QName[] getHeaders() {
              System.out.println("Handler Header method called");
              try     {
                   Map map = handlerInfo.getHandlerConfig();
                   QName[] headers = handlerInfo.getHeaders();
                   System.out.println(" Config :"+map);
                   for(int i=0;i<headers.length;i++)     {
                        System.out.println(headers.getLocalPart()+" "+
                        headers[i].toString()+" "+headers[i].getNamespaceURI());
              }catch(Exception e)     {
                   e.printStackTrace();
              return handlerInfo.getHeaders();
         public boolean handleRequest(MessageContext mc) {   
              SOAPMessageContext smc = (SOAPMessageContext) mc;
              System.out.println("Calling handler class.....................");
              try     {
              SOAPEnvelope se =      smc.getMessage().getSOAPPart().getEnvelope();
              System.out.println("Calling handler class.....................");
         SOAPHeader soapHeader = se.getHeader();
         Name headerName = se.createName("Security","wsse","http://schemas.xmlsoap.org/ws/2002/07/secext");
         SOAPHeaderElement headerElement = soapHeader.addHeaderElement(headerName);
         SOAPElement element = headerElement.addChildElement(se.createName("UsernameToken", "wsse", "http://schemas.xmlsoap.org/ws/2002/07/secext"));
         element.addChildElement(se.createName("Username", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testuser");
         element.addChildElement(se.createName("Password", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testpwd");
         System.out.println("Calling handler class.....................");
                   System.out.println("** Request: \n "+se.toString()+"\n");
              }catch(SOAPException e)     {
                   e.printStackTrace();
              return true;
         /** * Specifies that the SOAP response message be logged to a
         * log file before the
         * * message is sent back to the client application
         * that invoked the Web service.
         public boolean handleResponse(MessageContext mc) {  
              System.out.println("Handler Response method called");
              SOAPMessageContext messageContext = (SOAPMessageContext) mc;
              System.out.println("** Response: \n"+messageContext.getMessage().toString()+"\n");
              return true;
         /** * Specifies that a message be logged to the log file if a SOAP fault is
         * * thrown by the Handler instance.
         public boolean handleFault(MessageContext mc) {   
              SOAPMessageContext messageContext = (SOAPMessageContext) mc;
              System.out.println("** Fault: \n"+messageContext.getMessage().toString()+"\n");
              return true;
    Please need help here.
    Thanks in Advance,
    pps

    I have tested static client calling using handler simple above service and found the issues.
    QName portName = new QName(namespace,
    *"RemoteServicePortType");*
    The above line code has created the issues,becuase in wsdl file ( given similar wsdl file).
    <?xml version="1.0"; encoding="UTF-8"?>
    <definitions name="HelloService"
    targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <message name="SayHelloRequest">
    <part name="firstName" type="xsd:string"/>
    </message>
    <message name="SayHelloResponse">
    <part name="greeting" type="xsd:string"/>
    </message>
    <portType name="*RemoteServicePortType*">
    <operation name="sayHello">
    <input message="tns:SayHelloRequest"/>
    <output message="tns:SayHelloResponse"/>
    </operation>
    </portType>
    <binding name="Hello_Binding" type="tns:*RemoteServicePortType*">
    <soap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="sayHello">
    <soap:operation soapAction="sayHello"/>
    <input>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </input>
    <output>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </output>
    </operation>
    </binding>
    <service name="Hello_Service">
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType1*">+
    +<soap:address+
    location="http://host1:8080/soap/servlet/rpcrouter"/>
    +</port>+
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType2*">+
    +<soap:address+
    location="http://host2:8080/soap/servlet/rpcrouter"/>
    +</port>+
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType3*">+
    +<soap:address+
    location="http://host3:8080/soap/servlet/rpcrouter"/>
    +</port>+
    +<port binding="tns:Hello_Binding" name="*RemoteServicePortType4*">+
    +<soap:address+
    location="http://host4:8080/soap/servlet/rpcrouter"/>
    +</port>+
    </service>
    </definitions>
    From the above WSDL, I have four port name (port binding="tns:Hello_Binding" name="*RemoteServicePortType1*) which is not matching with PortType (portType name="*RemoteServicePortType*")
    even i have iterated from getPorts() method and used to invoke the service.But handler was not calling when i invoke.
    Please guide me here how i specify correct portname which can call Handler class also.
    Thanks in advance,
    pps

  • Services error "could not be started"

    The "Right-Click" Services Menu options are giving me an error.  It doesn't matter which Service I choose.  The error I get is this::
    "The “New Bean Document Containing Selection” service could not be used."  Or, it could be "Statistics" in the quotes, or another Bean application service, or "Reformat" etc. etc.  It happens in any application (where there are Services to choose from).
    So far, if I reboot, it goes away.  But, it's VERY annoying having to reboot all the time.
    I am using SL 10.6.8
    Any ideas?  Suggestions?

    MobileMe was discontinued at the end of June 2012. The control panel should be removed if still present. See HT2992: MobileMe: Uninstalling the MobileMe Control Panel for Windows for details.
    tt2

  • Web server error: Could not register a HeartbeatMonitor

              Hi:
              When I use weblogic thin client (wljmsclient) and createTopicConnection()
              causes weblogic server exception below.
              Seems it depends on where my client runs. Not sure if it is related to
              network configuration for different subnet.
              Thanks in advance for your help. (weblogic server 8.1.1 or 8.1.2, IIOP protocol
              for client connection)
              Here is the exception:
              weblogic.jms.dispatcher.DispatcherException: Could not register a HeartbeatMonit
              orListener for [weblogic.iiop.IIOPRemoteRef@8b4c94fa] for weblogic.jms.C:HP01:4t
              :-38
              at weblogic.jms.dispatcher.DispatcherWrapperState.addPeerGoneListener(Di
              spatcherWrapperState.java:569)
              at weblogic.jms.dispatcher.DispatcherManager.dispatcherAdd(DispatcherMan
              ager.java:106)
              at weblogic.jms.dispatcher.DispatcherManager.addDispatcherReference(Disp
              atcherManager.java:196)
              at weblogic.jms.frontend.FEConnectionFactory.connectionCreateInternal(FE
              ConnectionFactory.java:413)
              at weblogic.jms.frontend.FEConnectionFactory.connectionCreateRequest(FEC
              onnectionFactory.java:385)
              at weblogic.jms.frontend.FEConnectionFactory_WLSkel.invoke(Unknown Sourc
              e)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
              at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
              ef.java:108)
              at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
              at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
              dSubject.java:353)
              at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
              144)
              Tony
              

    Hi Tony,
              I wonder if there was a regression between 8.1.1 and 8.1.2? Anyhow,
              since the weblogic.jar works on the client, and since you verified
              your classpaths, it seems quite likely the problem is in WebLogic.
              I recommend two things:
              (1) ensure that you are using a supported version of the JVM
              (2) filing a support case and using weblogic.jar
              as a temporary work-around while the problem gets fixed
              Sorry I couldn't help you more.
              Tom
              tony wrote:
              > Tom:
              >
              > Thanks.
              > See my answer below:
              >
              >
              > Tom Barnes <[email protected].bea.com>
              > wrote:
              >
              >>Hi Tony,
              >>
              >>Some questions/thoughts:
              >>
              >>Is that the full stack trace?
              >
              >
              > There are few more lines: (paste from weblogic server log)
              >
              > at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
              > 144)
              > at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
              > :404)
              > at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
              > java:30)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
              > aused by: weblogic.rmi.extensions.server.HeartbeatMonitorUnavailableException:
              > ould not register a HeartbeatMonitorListener for [weblogic.iiop.IIOPRemoteRef@a8
              > 2e47e4]
              > at weblogic.rmi.extensions.server.HeartbeatMonitor.addHeartbeatMonitorLi
              > tener(HeartbeatMonitor.java:86)
              > at weblogic.jms.dispatcher.DispatcherWrapperState.addPeerGoneListener(Di
              > patcherWrapperState.java:559)
              > ... 14 more
              >
              >
              >
              >
              >>Did you use 8.1.2 jars for BOTH the client and the server?
              >
              >
              > yes
              >
              >
              >>Check that the server has no thin client jar in
              >>its classpath and that the client has no weblogic.jar in
              >>its classpath?
              >
              > Double checked.
              > Actually if client uses weblogic.jar, instead of wljmsclient and wlclient (thin
              > client), it works, and no this exception.
              >
              > Tony
              >
              >>Tom
              >>
              >>Tony wrote:
              >>
              >>>Hi:
              >>>
              >>> When I use weblogic thin client (wljmsclient) and createTopicConnection()
              >>>causes weblogic server exception below.
              >>> Seems it depends on where my client runs. Not sure if it is
              >>
              >>related to
              >>
              >>>network configuration for different subnet.
              >>> Thanks in advance for your help. (weblogic server 8.1.1 or 8.1.2,
              >>
              >>IIOP protocol
              >>
              >>>for client connection)
              >>>
              >>> Here is the exception:
              >>>
              >>>weblogic.jms.dispatcher.DispatcherException: Could not register a HeartbeatMonit
              >>>
              >>>orListener for [weblogic.iiop.IIOPRemoteRef@8b4c94fa] for weblogic.jms.C:HP01:4t
              >>>
              >>>:-38
              >>>
              >>> at weblogic.jms.dispatcher.DispatcherWrapperState.addPeerGoneListener(Di
              >>>
              >>>spatcherWrapperState.java:569)
              >>>
              >>> at weblogic.jms.dispatcher.DispatcherManager.dispatcherAdd(DispatcherMan
              >>>
              >>>ager.java:106)
              >>>
              >>> at weblogic.jms.dispatcher.DispatcherManager.addDispatcherReference(Disp
              >>>
              >>>atcherManager.java:196)
              >>>
              >>> at weblogic.jms.frontend.FEConnectionFactory.connectionCreateInternal(FE
              >>>
              >>>ConnectionFactory.java:413)
              >>>
              >>> at weblogic.jms.frontend.FEConnectionFactory.connectionCreateRequest(FEC
              >>>
              >>>onnectionFactory.java:385)
              >>>
              >>> at weblogic.jms.frontend.FEConnectionFactory_WLSkel.invoke(Unknown
              >>
              >>Sourc
              >>
              >>>e)
              >>>
              >>> at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
              >>>
              >>> at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
              >>>
              >>>ef.java:108)
              >>>
              >>> at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
              >>>
              >>> at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
              >>>
              >>>dSubject.java:353)
              >>>
              >>> at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
              >>>
              >>>144)
              >>>
              >>>
              >>>
              >>>Tony
              >>>
              >>>
              >>
              >
              

Maybe you are looking for

  • Hi all I have a problem with my ipod touch 4g

    hi all I have a problem with my ipod touch 4g update and does not let either turn left stays in the loop of the block when I try to update the error stays in 3914, I looked at the host file and everything is in order any one could help me?

  • Can't sign into revel from photoshop

    I cannot sign into revel while in photoshop to sync my photos.  I am using windows 7.  The revel account ios active and able to be accessed from outside photoshop. How do I fix photoshop to link with revel again?

  • Assigning a bunch of order to a technician very quickly

    Hello Experts, We have 200-300 Orders generated for preventive maintenance every day in our plant. So it makes the Supervisor's life really difficult to assign those Orders to the Technicians in the order header - user responsible field on by one. We

  • Annotations for adobe reader

    Hi there I use adobe reader for college and find it perfect. This week I have tried to add notes and highlight different parts o the lecture notes and I can't find the annotation button. I have deleted the app and reinstalled it but the same thing ha

  • Regular Expressions with Unicode Strings - length restriction?

    Hi, I can't quite figure this one out. I am checking a String for the presence of a URL.. more specifically, a jpg or gif URL. Anyway, the following reg exp will work fine for me. However, when testing with unicode data (chinese text) the expression